@aws-sdk/client-kinesis-video-archived-media 3.310.0 → 3.315.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.
@@ -12,13 +12,11 @@ const se_GetClipCommand = async (input, context) => {
12
12
  };
13
13
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getClip";
14
14
  let body;
15
- body = JSON.stringify({
16
- ...(input.ClipFragmentSelector != null && {
17
- ClipFragmentSelector: se_ClipFragmentSelector(input.ClipFragmentSelector, context),
18
- }),
19
- ...(input.StreamARN != null && { StreamARN: input.StreamARN }),
20
- ...(input.StreamName != null && { StreamName: input.StreamName }),
21
- });
15
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
16
+ ClipFragmentSelector: (_) => se_ClipFragmentSelector(_, context),
17
+ StreamARN: [],
18
+ StreamName: [],
19
+ }));
22
20
  return new protocol_http_1.HttpRequest({
23
21
  protocol,
24
22
  hostname,
@@ -37,18 +35,16 @@ const se_GetDASHStreamingSessionURLCommand = async (input, context) => {
37
35
  };
38
36
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getDASHStreamingSessionURL";
39
37
  let body;
40
- body = JSON.stringify({
41
- ...(input.DASHFragmentSelector != null && {
42
- DASHFragmentSelector: se_DASHFragmentSelector(input.DASHFragmentSelector, context),
43
- }),
44
- ...(input.DisplayFragmentNumber != null && { DisplayFragmentNumber: input.DisplayFragmentNumber }),
45
- ...(input.DisplayFragmentTimestamp != null && { DisplayFragmentTimestamp: input.DisplayFragmentTimestamp }),
46
- ...(input.Expires != null && { Expires: input.Expires }),
47
- ...(input.MaxManifestFragmentResults != null && { MaxManifestFragmentResults: input.MaxManifestFragmentResults }),
48
- ...(input.PlaybackMode != null && { PlaybackMode: input.PlaybackMode }),
49
- ...(input.StreamARN != null && { StreamARN: input.StreamARN }),
50
- ...(input.StreamName != null && { StreamName: input.StreamName }),
51
- });
38
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
39
+ DASHFragmentSelector: (_) => se_DASHFragmentSelector(_, context),
40
+ DisplayFragmentNumber: [],
41
+ DisplayFragmentTimestamp: [],
42
+ Expires: [],
43
+ MaxManifestFragmentResults: [],
44
+ PlaybackMode: [],
45
+ StreamARN: [],
46
+ StreamName: [],
47
+ }));
52
48
  return new protocol_http_1.HttpRequest({
53
49
  protocol,
54
50
  hostname,
@@ -67,21 +63,17 @@ const se_GetHLSStreamingSessionURLCommand = async (input, context) => {
67
63
  };
68
64
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getHLSStreamingSessionURL";
69
65
  let body;
70
- body = JSON.stringify({
71
- ...(input.ContainerFormat != null && { ContainerFormat: input.ContainerFormat }),
72
- ...(input.DiscontinuityMode != null && { DiscontinuityMode: input.DiscontinuityMode }),
73
- ...(input.DisplayFragmentTimestamp != null && { DisplayFragmentTimestamp: input.DisplayFragmentTimestamp }),
74
- ...(input.Expires != null && { Expires: input.Expires }),
75
- ...(input.HLSFragmentSelector != null && {
76
- HLSFragmentSelector: se_HLSFragmentSelector(input.HLSFragmentSelector, context),
77
- }),
78
- ...(input.MaxMediaPlaylistFragmentResults != null && {
79
- MaxMediaPlaylistFragmentResults: input.MaxMediaPlaylistFragmentResults,
80
- }),
81
- ...(input.PlaybackMode != null && { PlaybackMode: input.PlaybackMode }),
82
- ...(input.StreamARN != null && { StreamARN: input.StreamARN }),
83
- ...(input.StreamName != null && { StreamName: input.StreamName }),
84
- });
66
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
67
+ ContainerFormat: [],
68
+ DiscontinuityMode: [],
69
+ DisplayFragmentTimestamp: [],
70
+ Expires: [],
71
+ HLSFragmentSelector: (_) => se_HLSFragmentSelector(_, context),
72
+ MaxMediaPlaylistFragmentResults: [],
73
+ PlaybackMode: [],
74
+ StreamARN: [],
75
+ StreamName: [],
76
+ }));
85
77
  return new protocol_http_1.HttpRequest({
86
78
  protocol,
87
79
  hostname,
@@ -100,20 +92,20 @@ const se_GetImagesCommand = async (input, context) => {
100
92
  };
101
93
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getImages";
102
94
  let body;
103
- body = JSON.stringify({
104
- ...(input.EndTimestamp != null && { EndTimestamp: Math.round(input.EndTimestamp.getTime() / 1000) }),
105
- ...(input.Format != null && { Format: input.Format }),
106
- ...(input.FormatConfig != null && { FormatConfig: se_FormatConfig(input.FormatConfig, context) }),
107
- ...(input.HeightPixels != null && { HeightPixels: input.HeightPixels }),
108
- ...(input.ImageSelectorType != null && { ImageSelectorType: input.ImageSelectorType }),
109
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
110
- ...(input.NextToken != null && { NextToken: input.NextToken }),
111
- ...(input.SamplingInterval != null && { SamplingInterval: input.SamplingInterval }),
112
- ...(input.StartTimestamp != null && { StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) }),
113
- ...(input.StreamARN != null && { StreamARN: input.StreamARN }),
114
- ...(input.StreamName != null && { StreamName: input.StreamName }),
115
- ...(input.WidthPixels != null && { WidthPixels: input.WidthPixels }),
116
- });
95
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
96
+ EndTimestamp: (_) => Math.round(_.getTime() / 1000),
97
+ Format: [],
98
+ FormatConfig: (_) => (0, smithy_client_1._json)(_),
99
+ HeightPixels: [],
100
+ ImageSelectorType: [],
101
+ MaxResults: [],
102
+ NextToken: [],
103
+ SamplingInterval: [],
104
+ StartTimestamp: (_) => Math.round(_.getTime() / 1000),
105
+ StreamARN: [],
106
+ StreamName: [],
107
+ WidthPixels: [],
108
+ }));
117
109
  return new protocol_http_1.HttpRequest({
118
110
  protocol,
119
111
  hostname,
@@ -132,11 +124,11 @@ const se_GetMediaForFragmentListCommand = async (input, context) => {
132
124
  };
133
125
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getMediaForFragmentList";
134
126
  let body;
135
- body = JSON.stringify({
136
- ...(input.Fragments != null && { Fragments: se_FragmentNumberList(input.Fragments, context) }),
137
- ...(input.StreamARN != null && { StreamARN: input.StreamARN }),
138
- ...(input.StreamName != null && { StreamName: input.StreamName }),
139
- });
127
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
128
+ Fragments: (_) => (0, smithy_client_1._json)(_),
129
+ StreamARN: [],
130
+ StreamName: [],
131
+ }));
140
132
  return new protocol_http_1.HttpRequest({
141
133
  protocol,
142
134
  hostname,
@@ -155,13 +147,13 @@ const se_ListFragmentsCommand = async (input, context) => {
155
147
  };
156
148
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/listFragments";
157
149
  let body;
158
- body = JSON.stringify({
159
- ...(input.FragmentSelector != null && { FragmentSelector: se_FragmentSelector(input.FragmentSelector, context) }),
160
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
161
- ...(input.NextToken != null && { NextToken: input.NextToken }),
162
- ...(input.StreamARN != null && { StreamARN: input.StreamARN }),
163
- ...(input.StreamName != null && { StreamName: input.StreamName }),
164
- });
150
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
151
+ FragmentSelector: (_) => se_FragmentSelector(_, context),
152
+ MaxResults: [],
153
+ NextToken: [],
154
+ StreamARN: [],
155
+ StreamName: [],
156
+ }));
165
157
  return new protocol_http_1.HttpRequest({
166
158
  protocol,
167
159
  hostname,
@@ -177,7 +169,7 @@ const de_GetClipCommand = async (output, context) => {
177
169
  if (output.statusCode !== 200 && output.statusCode >= 300) {
178
170
  return de_GetClipCommandError(output, context);
179
171
  }
180
- const contents = map({
172
+ const contents = (0, smithy_client_1.map)({
181
173
  $metadata: deserializeMetadata(output),
182
174
  ContentType: [, output.headers["content-type"]],
183
175
  });
@@ -223,10 +215,9 @@ const de_GetClipCommandError = async (output, context) => {
223
215
  throw await de_UnsupportedStreamMediaTypeExceptionRes(parsedOutput, context);
224
216
  default:
225
217
  const parsedBody = parsedOutput.body;
226
- (0, smithy_client_1.throwDefaultError)({
218
+ return throwDefaultError({
227
219
  output,
228
220
  parsedBody,
229
- exceptionCtor: KinesisVideoArchivedMediaServiceException_1.KinesisVideoArchivedMediaServiceException,
230
221
  errorCode,
231
222
  });
232
223
  }
@@ -235,13 +226,14 @@ const de_GetDASHStreamingSessionURLCommand = async (output, context) => {
235
226
  if (output.statusCode !== 200 && output.statusCode >= 300) {
236
227
  return de_GetDASHStreamingSessionURLCommandError(output, context);
237
228
  }
238
- const contents = map({
229
+ const contents = (0, smithy_client_1.map)({
239
230
  $metadata: deserializeMetadata(output),
240
231
  });
241
232
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
242
- if (data.DASHStreamingSessionURL != null) {
243
- contents.DASHStreamingSessionURL = (0, smithy_client_1.expectString)(data.DASHStreamingSessionURL);
244
- }
233
+ const doc = (0, smithy_client_1.take)(data, {
234
+ DASHStreamingSessionURL: smithy_client_1.expectString,
235
+ });
236
+ Object.assign(contents, doc);
245
237
  return contents;
246
238
  };
247
239
  exports.de_GetDASHStreamingSessionURLCommand = de_GetDASHStreamingSessionURLCommand;
@@ -278,10 +270,9 @@ const de_GetDASHStreamingSessionURLCommandError = async (output, context) => {
278
270
  throw await de_UnsupportedStreamMediaTypeExceptionRes(parsedOutput, context);
279
271
  default:
280
272
  const parsedBody = parsedOutput.body;
281
- (0, smithy_client_1.throwDefaultError)({
273
+ return throwDefaultError({
282
274
  output,
283
275
  parsedBody,
284
- exceptionCtor: KinesisVideoArchivedMediaServiceException_1.KinesisVideoArchivedMediaServiceException,
285
276
  errorCode,
286
277
  });
287
278
  }
@@ -290,13 +281,14 @@ const de_GetHLSStreamingSessionURLCommand = async (output, context) => {
290
281
  if (output.statusCode !== 200 && output.statusCode >= 300) {
291
282
  return de_GetHLSStreamingSessionURLCommandError(output, context);
292
283
  }
293
- const contents = map({
284
+ const contents = (0, smithy_client_1.map)({
294
285
  $metadata: deserializeMetadata(output),
295
286
  });
296
287
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
297
- if (data.HLSStreamingSessionURL != null) {
298
- contents.HLSStreamingSessionURL = (0, smithy_client_1.expectString)(data.HLSStreamingSessionURL);
299
- }
288
+ const doc = (0, smithy_client_1.take)(data, {
289
+ HLSStreamingSessionURL: smithy_client_1.expectString,
290
+ });
291
+ Object.assign(contents, doc);
300
292
  return contents;
301
293
  };
302
294
  exports.de_GetHLSStreamingSessionURLCommand = de_GetHLSStreamingSessionURLCommand;
@@ -333,10 +325,9 @@ const de_GetHLSStreamingSessionURLCommandError = async (output, context) => {
333
325
  throw await de_UnsupportedStreamMediaTypeExceptionRes(parsedOutput, context);
334
326
  default:
335
327
  const parsedBody = parsedOutput.body;
336
- (0, smithy_client_1.throwDefaultError)({
328
+ return throwDefaultError({
337
329
  output,
338
330
  parsedBody,
339
- exceptionCtor: KinesisVideoArchivedMediaServiceException_1.KinesisVideoArchivedMediaServiceException,
340
331
  errorCode,
341
332
  });
342
333
  }
@@ -345,16 +336,15 @@ const de_GetImagesCommand = async (output, context) => {
345
336
  if (output.statusCode !== 200 && output.statusCode >= 300) {
346
337
  return de_GetImagesCommandError(output, context);
347
338
  }
348
- const contents = map({
339
+ const contents = (0, smithy_client_1.map)({
349
340
  $metadata: deserializeMetadata(output),
350
341
  });
351
342
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
352
- if (data.Images != null) {
353
- contents.Images = de_Images(data.Images, context);
354
- }
355
- if (data.NextToken != null) {
356
- contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
357
- }
343
+ const doc = (0, smithy_client_1.take)(data, {
344
+ Images: (_) => de_Images(_, context),
345
+ NextToken: smithy_client_1.expectString,
346
+ });
347
+ Object.assign(contents, doc);
358
348
  return contents;
359
349
  };
360
350
  exports.de_GetImagesCommand = de_GetImagesCommand;
@@ -379,10 +369,9 @@ const de_GetImagesCommandError = async (output, context) => {
379
369
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
380
370
  default:
381
371
  const parsedBody = parsedOutput.body;
382
- (0, smithy_client_1.throwDefaultError)({
372
+ return throwDefaultError({
383
373
  output,
384
374
  parsedBody,
385
- exceptionCtor: KinesisVideoArchivedMediaServiceException_1.KinesisVideoArchivedMediaServiceException,
386
375
  errorCode,
387
376
  });
388
377
  }
@@ -391,7 +380,7 @@ const de_GetMediaForFragmentListCommand = async (output, context) => {
391
380
  if (output.statusCode !== 200 && output.statusCode >= 300) {
392
381
  return de_GetMediaForFragmentListCommandError(output, context);
393
382
  }
394
- const contents = map({
383
+ const contents = (0, smithy_client_1.map)({
395
384
  $metadata: deserializeMetadata(output),
396
385
  ContentType: [, output.headers["content-type"]],
397
386
  });
@@ -422,10 +411,9 @@ const de_GetMediaForFragmentListCommandError = async (output, context) => {
422
411
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
423
412
  default:
424
413
  const parsedBody = parsedOutput.body;
425
- (0, smithy_client_1.throwDefaultError)({
414
+ return throwDefaultError({
426
415
  output,
427
416
  parsedBody,
428
- exceptionCtor: KinesisVideoArchivedMediaServiceException_1.KinesisVideoArchivedMediaServiceException,
429
417
  errorCode,
430
418
  });
431
419
  }
@@ -434,16 +422,15 @@ const de_ListFragmentsCommand = async (output, context) => {
434
422
  if (output.statusCode !== 200 && output.statusCode >= 300) {
435
423
  return de_ListFragmentsCommandError(output, context);
436
424
  }
437
- const contents = map({
425
+ const contents = (0, smithy_client_1.map)({
438
426
  $metadata: deserializeMetadata(output),
439
427
  });
440
428
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
441
- if (data.Fragments != null) {
442
- contents.Fragments = de_FragmentList(data.Fragments, context);
443
- }
444
- if (data.NextToken != null) {
445
- contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
446
- }
429
+ const doc = (0, smithy_client_1.take)(data, {
430
+ Fragments: (_) => de_FragmentList(_, context),
431
+ NextToken: smithy_client_1.expectString,
432
+ });
433
+ Object.assign(contents, doc);
447
434
  return contents;
448
435
  };
449
436
  exports.de_ListFragmentsCommand = de_ListFragmentsCommand;
@@ -468,21 +455,21 @@ const de_ListFragmentsCommandError = async (output, context) => {
468
455
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
469
456
  default:
470
457
  const parsedBody = parsedOutput.body;
471
- (0, smithy_client_1.throwDefaultError)({
458
+ return throwDefaultError({
472
459
  output,
473
460
  parsedBody,
474
- exceptionCtor: KinesisVideoArchivedMediaServiceException_1.KinesisVideoArchivedMediaServiceException,
475
461
  errorCode,
476
462
  });
477
463
  }
478
464
  };
479
- const map = smithy_client_1.map;
465
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(KinesisVideoArchivedMediaServiceException_1.KinesisVideoArchivedMediaServiceException);
480
466
  const de_ClientLimitExceededExceptionRes = async (parsedOutput, context) => {
481
- const contents = map({});
467
+ const contents = (0, smithy_client_1.map)({});
482
468
  const data = parsedOutput.body;
483
- if (data.Message != null) {
484
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
485
- }
469
+ const doc = (0, smithy_client_1.take)(data, {
470
+ Message: smithy_client_1.expectString,
471
+ });
472
+ Object.assign(contents, doc);
486
473
  const exception = new models_0_1.ClientLimitExceededException({
487
474
  $metadata: deserializeMetadata(parsedOutput),
488
475
  ...contents,
@@ -490,11 +477,12 @@ const de_ClientLimitExceededExceptionRes = async (parsedOutput, context) => {
490
477
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
491
478
  };
492
479
  const de_InvalidArgumentExceptionRes = async (parsedOutput, context) => {
493
- const contents = map({});
480
+ const contents = (0, smithy_client_1.map)({});
494
481
  const data = parsedOutput.body;
495
- if (data.Message != null) {
496
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
497
- }
482
+ const doc = (0, smithy_client_1.take)(data, {
483
+ Message: smithy_client_1.expectString,
484
+ });
485
+ Object.assign(contents, doc);
498
486
  const exception = new models_0_1.InvalidArgumentException({
499
487
  $metadata: deserializeMetadata(parsedOutput),
500
488
  ...contents,
@@ -502,11 +490,12 @@ const de_InvalidArgumentExceptionRes = async (parsedOutput, context) => {
502
490
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
503
491
  };
504
492
  const de_InvalidCodecPrivateDataExceptionRes = async (parsedOutput, context) => {
505
- const contents = map({});
493
+ const contents = (0, smithy_client_1.map)({});
506
494
  const data = parsedOutput.body;
507
- if (data.Message != null) {
508
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
509
- }
495
+ const doc = (0, smithy_client_1.take)(data, {
496
+ Message: smithy_client_1.expectString,
497
+ });
498
+ Object.assign(contents, doc);
510
499
  const exception = new models_0_1.InvalidCodecPrivateDataException({
511
500
  $metadata: deserializeMetadata(parsedOutput),
512
501
  ...contents,
@@ -514,11 +503,12 @@ const de_InvalidCodecPrivateDataExceptionRes = async (parsedOutput, context) =>
514
503
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
515
504
  };
516
505
  const de_InvalidMediaFrameExceptionRes = async (parsedOutput, context) => {
517
- const contents = map({});
506
+ const contents = (0, smithy_client_1.map)({});
518
507
  const data = parsedOutput.body;
519
- if (data.Message != null) {
520
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
521
- }
508
+ const doc = (0, smithy_client_1.take)(data, {
509
+ Message: smithy_client_1.expectString,
510
+ });
511
+ Object.assign(contents, doc);
522
512
  const exception = new models_0_1.InvalidMediaFrameException({
523
513
  $metadata: deserializeMetadata(parsedOutput),
524
514
  ...contents,
@@ -526,11 +516,12 @@ const de_InvalidMediaFrameExceptionRes = async (parsedOutput, context) => {
526
516
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
527
517
  };
528
518
  const de_MissingCodecPrivateDataExceptionRes = async (parsedOutput, context) => {
529
- const contents = map({});
519
+ const contents = (0, smithy_client_1.map)({});
530
520
  const data = parsedOutput.body;
531
- if (data.Message != null) {
532
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
533
- }
521
+ const doc = (0, smithy_client_1.take)(data, {
522
+ Message: smithy_client_1.expectString,
523
+ });
524
+ Object.assign(contents, doc);
534
525
  const exception = new models_0_1.MissingCodecPrivateDataException({
535
526
  $metadata: deserializeMetadata(parsedOutput),
536
527
  ...contents,
@@ -538,11 +529,12 @@ const de_MissingCodecPrivateDataExceptionRes = async (parsedOutput, context) =>
538
529
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
539
530
  };
540
531
  const de_NoDataRetentionExceptionRes = async (parsedOutput, context) => {
541
- const contents = map({});
532
+ const contents = (0, smithy_client_1.map)({});
542
533
  const data = parsedOutput.body;
543
- if (data.Message != null) {
544
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
545
- }
534
+ const doc = (0, smithy_client_1.take)(data, {
535
+ Message: smithy_client_1.expectString,
536
+ });
537
+ Object.assign(contents, doc);
546
538
  const exception = new models_0_1.NoDataRetentionException({
547
539
  $metadata: deserializeMetadata(parsedOutput),
548
540
  ...contents,
@@ -550,11 +542,12 @@ const de_NoDataRetentionExceptionRes = async (parsedOutput, context) => {
550
542
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
551
543
  };
552
544
  const de_NotAuthorizedExceptionRes = async (parsedOutput, context) => {
553
- const contents = map({});
545
+ const contents = (0, smithy_client_1.map)({});
554
546
  const data = parsedOutput.body;
555
- if (data.Message != null) {
556
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
557
- }
547
+ const doc = (0, smithy_client_1.take)(data, {
548
+ Message: smithy_client_1.expectString,
549
+ });
550
+ Object.assign(contents, doc);
558
551
  const exception = new models_0_1.NotAuthorizedException({
559
552
  $metadata: deserializeMetadata(parsedOutput),
560
553
  ...contents,
@@ -562,11 +555,12 @@ const de_NotAuthorizedExceptionRes = async (parsedOutput, context) => {
562
555
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
563
556
  };
564
557
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
565
- const contents = map({});
558
+ const contents = (0, smithy_client_1.map)({});
566
559
  const data = parsedOutput.body;
567
- if (data.Message != null) {
568
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
569
- }
560
+ const doc = (0, smithy_client_1.take)(data, {
561
+ Message: smithy_client_1.expectString,
562
+ });
563
+ Object.assign(contents, doc);
570
564
  const exception = new models_0_1.ResourceNotFoundException({
571
565
  $metadata: deserializeMetadata(parsedOutput),
572
566
  ...contents,
@@ -574,11 +568,12 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
574
568
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
575
569
  };
576
570
  const de_UnsupportedStreamMediaTypeExceptionRes = async (parsedOutput, context) => {
577
- const contents = map({});
571
+ const contents = (0, smithy_client_1.map)({});
578
572
  const data = parsedOutput.body;
579
- if (data.Message != null) {
580
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
581
- }
573
+ const doc = (0, smithy_client_1.take)(data, {
574
+ Message: smithy_client_1.expectString,
575
+ });
576
+ Object.assign(contents, doc);
582
577
  const exception = new models_0_1.UnsupportedStreamMediaTypeException({
583
578
  $metadata: deserializeMetadata(parsedOutput),
584
579
  ...contents,
@@ -586,107 +581,81 @@ const de_UnsupportedStreamMediaTypeExceptionRes = async (parsedOutput, context)
586
581
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
587
582
  };
588
583
  const se_ClipFragmentSelector = (input, context) => {
589
- return {
590
- ...(input.FragmentSelectorType != null && { FragmentSelectorType: input.FragmentSelectorType }),
591
- ...(input.TimestampRange != null && { TimestampRange: se_ClipTimestampRange(input.TimestampRange, context) }),
592
- };
584
+ return (0, smithy_client_1.take)(input, {
585
+ FragmentSelectorType: [],
586
+ TimestampRange: (_) => se_ClipTimestampRange(_, context),
587
+ });
593
588
  };
594
589
  const se_ClipTimestampRange = (input, context) => {
595
- return {
596
- ...(input.EndTimestamp != null && { EndTimestamp: Math.round(input.EndTimestamp.getTime() / 1000) }),
597
- ...(input.StartTimestamp != null && { StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) }),
598
- };
590
+ return (0, smithy_client_1.take)(input, {
591
+ EndTimestamp: (_) => Math.round(_.getTime() / 1000),
592
+ StartTimestamp: (_) => Math.round(_.getTime() / 1000),
593
+ });
599
594
  };
600
595
  const se_DASHFragmentSelector = (input, context) => {
601
- return {
602
- ...(input.FragmentSelectorType != null && { FragmentSelectorType: input.FragmentSelectorType }),
603
- ...(input.TimestampRange != null && { TimestampRange: se_DASHTimestampRange(input.TimestampRange, context) }),
604
- };
596
+ return (0, smithy_client_1.take)(input, {
597
+ FragmentSelectorType: [],
598
+ TimestampRange: (_) => se_DASHTimestampRange(_, context),
599
+ });
605
600
  };
606
601
  const se_DASHTimestampRange = (input, context) => {
607
- return {
608
- ...(input.EndTimestamp != null && { EndTimestamp: Math.round(input.EndTimestamp.getTime() / 1000) }),
609
- ...(input.StartTimestamp != null && { StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) }),
610
- };
611
- };
612
- const se_FormatConfig = (input, context) => {
613
- return Object.entries(input).reduce((acc, [key, value]) => {
614
- if (value === null) {
615
- return acc;
616
- }
617
- acc[key] = value;
618
- return acc;
619
- }, {});
620
- };
621
- const se_FragmentNumberList = (input, context) => {
622
- return input
623
- .filter((e) => e != null)
624
- .map((entry) => {
625
- return entry;
602
+ return (0, smithy_client_1.take)(input, {
603
+ EndTimestamp: (_) => Math.round(_.getTime() / 1000),
604
+ StartTimestamp: (_) => Math.round(_.getTime() / 1000),
626
605
  });
627
606
  };
628
607
  const se_FragmentSelector = (input, context) => {
629
- return {
630
- ...(input.FragmentSelectorType != null && { FragmentSelectorType: input.FragmentSelectorType }),
631
- ...(input.TimestampRange != null && { TimestampRange: se_TimestampRange(input.TimestampRange, context) }),
632
- };
608
+ return (0, smithy_client_1.take)(input, {
609
+ FragmentSelectorType: [],
610
+ TimestampRange: (_) => se_TimestampRange(_, context),
611
+ });
633
612
  };
634
613
  const se_HLSFragmentSelector = (input, context) => {
635
- return {
636
- ...(input.FragmentSelectorType != null && { FragmentSelectorType: input.FragmentSelectorType }),
637
- ...(input.TimestampRange != null && { TimestampRange: se_HLSTimestampRange(input.TimestampRange, context) }),
638
- };
614
+ return (0, smithy_client_1.take)(input, {
615
+ FragmentSelectorType: [],
616
+ TimestampRange: (_) => se_HLSTimestampRange(_, context),
617
+ });
639
618
  };
640
619
  const se_HLSTimestampRange = (input, context) => {
641
- return {
642
- ...(input.EndTimestamp != null && { EndTimestamp: Math.round(input.EndTimestamp.getTime() / 1000) }),
643
- ...(input.StartTimestamp != null && { StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) }),
644
- };
620
+ return (0, smithy_client_1.take)(input, {
621
+ EndTimestamp: (_) => Math.round(_.getTime() / 1000),
622
+ StartTimestamp: (_) => Math.round(_.getTime() / 1000),
623
+ });
645
624
  };
646
625
  const se_TimestampRange = (input, context) => {
647
- return {
648
- ...(input.EndTimestamp != null && { EndTimestamp: Math.round(input.EndTimestamp.getTime() / 1000) }),
649
- ...(input.StartTimestamp != null && { StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) }),
650
- };
626
+ return (0, smithy_client_1.take)(input, {
627
+ EndTimestamp: (_) => Math.round(_.getTime() / 1000),
628
+ StartTimestamp: (_) => Math.round(_.getTime() / 1000),
629
+ });
651
630
  };
652
631
  const de_Fragment = (output, context) => {
653
- return {
654
- FragmentLengthInMilliseconds: (0, smithy_client_1.expectLong)(output.FragmentLengthInMilliseconds),
655
- FragmentNumber: (0, smithy_client_1.expectString)(output.FragmentNumber),
656
- FragmentSizeInBytes: (0, smithy_client_1.expectLong)(output.FragmentSizeInBytes),
657
- ProducerTimestamp: output.ProducerTimestamp != null
658
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.ProducerTimestamp)))
659
- : undefined,
660
- ServerTimestamp: output.ServerTimestamp != null
661
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.ServerTimestamp)))
662
- : undefined,
663
- };
632
+ return (0, smithy_client_1.take)(output, {
633
+ FragmentLengthInMilliseconds: smithy_client_1.expectLong,
634
+ FragmentNumber: smithy_client_1.expectString,
635
+ FragmentSizeInBytes: smithy_client_1.expectLong,
636
+ ProducerTimestamp: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
637
+ ServerTimestamp: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
638
+ });
664
639
  };
665
640
  const de_FragmentList = (output, context) => {
666
641
  const retVal = (output || [])
667
642
  .filter((e) => e != null)
668
643
  .map((entry) => {
669
- if (entry === null) {
670
- return null;
671
- }
672
644
  return de_Fragment(entry, context);
673
645
  });
674
646
  return retVal;
675
647
  };
676
648
  const de_Image = (output, context) => {
677
- return {
678
- Error: (0, smithy_client_1.expectString)(output.Error),
679
- ImageContent: (0, smithy_client_1.expectString)(output.ImageContent),
680
- TimeStamp: output.TimeStamp != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.TimeStamp))) : undefined,
681
- };
649
+ return (0, smithy_client_1.take)(output, {
650
+ Error: smithy_client_1.expectString,
651
+ ImageContent: smithy_client_1.expectString,
652
+ TimeStamp: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
653
+ });
682
654
  };
683
655
  const de_Images = (output, context) => {
684
656
  const retVal = (output || [])
685
657
  .filter((e) => e != null)
686
658
  .map((entry) => {
687
- if (entry === null) {
688
- return null;
689
- }
690
659
  return de_Image(entry, context);
691
660
  });
692
661
  return retVal;
@@ -1,5 +1,5 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { KinesisVideoArchivedMediaServiceException as __BaseException } from "../models/KinesisVideoArchivedMediaServiceException";
4
4
  import { ClientLimitExceededException, InvalidArgumentException, InvalidCodecPrivateDataException, InvalidMediaFrameException, MissingCodecPrivateDataException, NoDataRetentionException, NotAuthorizedException, ResourceNotFoundException, UnsupportedStreamMediaTypeException, } from "../models/models_0";
5
5
  export const se_GetClipCommand = async (input, context) => {
@@ -9,13 +9,11 @@ export const se_GetClipCommand = async (input, context) => {
9
9
  };
10
10
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getClip";
11
11
  let body;
12
- body = JSON.stringify({
13
- ...(input.ClipFragmentSelector != null && {
14
- ClipFragmentSelector: se_ClipFragmentSelector(input.ClipFragmentSelector, context),
15
- }),
16
- ...(input.StreamARN != null && { StreamARN: input.StreamARN }),
17
- ...(input.StreamName != null && { StreamName: input.StreamName }),
18
- });
12
+ body = JSON.stringify(take(input, {
13
+ ClipFragmentSelector: (_) => se_ClipFragmentSelector(_, context),
14
+ StreamARN: [],
15
+ StreamName: [],
16
+ }));
19
17
  return new __HttpRequest({
20
18
  protocol,
21
19
  hostname,
@@ -33,18 +31,16 @@ export const se_GetDASHStreamingSessionURLCommand = async (input, context) => {
33
31
  };
34
32
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getDASHStreamingSessionURL";
35
33
  let body;
36
- body = JSON.stringify({
37
- ...(input.DASHFragmentSelector != null && {
38
- DASHFragmentSelector: se_DASHFragmentSelector(input.DASHFragmentSelector, context),
39
- }),
40
- ...(input.DisplayFragmentNumber != null && { DisplayFragmentNumber: input.DisplayFragmentNumber }),
41
- ...(input.DisplayFragmentTimestamp != null && { DisplayFragmentTimestamp: input.DisplayFragmentTimestamp }),
42
- ...(input.Expires != null && { Expires: input.Expires }),
43
- ...(input.MaxManifestFragmentResults != null && { MaxManifestFragmentResults: input.MaxManifestFragmentResults }),
44
- ...(input.PlaybackMode != null && { PlaybackMode: input.PlaybackMode }),
45
- ...(input.StreamARN != null && { StreamARN: input.StreamARN }),
46
- ...(input.StreamName != null && { StreamName: input.StreamName }),
47
- });
34
+ body = JSON.stringify(take(input, {
35
+ DASHFragmentSelector: (_) => se_DASHFragmentSelector(_, context),
36
+ DisplayFragmentNumber: [],
37
+ DisplayFragmentTimestamp: [],
38
+ Expires: [],
39
+ MaxManifestFragmentResults: [],
40
+ PlaybackMode: [],
41
+ StreamARN: [],
42
+ StreamName: [],
43
+ }));
48
44
  return new __HttpRequest({
49
45
  protocol,
50
46
  hostname,
@@ -62,21 +58,17 @@ export const se_GetHLSStreamingSessionURLCommand = async (input, context) => {
62
58
  };
63
59
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getHLSStreamingSessionURL";
64
60
  let body;
65
- body = JSON.stringify({
66
- ...(input.ContainerFormat != null && { ContainerFormat: input.ContainerFormat }),
67
- ...(input.DiscontinuityMode != null && { DiscontinuityMode: input.DiscontinuityMode }),
68
- ...(input.DisplayFragmentTimestamp != null && { DisplayFragmentTimestamp: input.DisplayFragmentTimestamp }),
69
- ...(input.Expires != null && { Expires: input.Expires }),
70
- ...(input.HLSFragmentSelector != null && {
71
- HLSFragmentSelector: se_HLSFragmentSelector(input.HLSFragmentSelector, context),
72
- }),
73
- ...(input.MaxMediaPlaylistFragmentResults != null && {
74
- MaxMediaPlaylistFragmentResults: input.MaxMediaPlaylistFragmentResults,
75
- }),
76
- ...(input.PlaybackMode != null && { PlaybackMode: input.PlaybackMode }),
77
- ...(input.StreamARN != null && { StreamARN: input.StreamARN }),
78
- ...(input.StreamName != null && { StreamName: input.StreamName }),
79
- });
61
+ body = JSON.stringify(take(input, {
62
+ ContainerFormat: [],
63
+ DiscontinuityMode: [],
64
+ DisplayFragmentTimestamp: [],
65
+ Expires: [],
66
+ HLSFragmentSelector: (_) => se_HLSFragmentSelector(_, context),
67
+ MaxMediaPlaylistFragmentResults: [],
68
+ PlaybackMode: [],
69
+ StreamARN: [],
70
+ StreamName: [],
71
+ }));
80
72
  return new __HttpRequest({
81
73
  protocol,
82
74
  hostname,
@@ -94,20 +86,20 @@ export const se_GetImagesCommand = async (input, context) => {
94
86
  };
95
87
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getImages";
96
88
  let body;
97
- body = JSON.stringify({
98
- ...(input.EndTimestamp != null && { EndTimestamp: Math.round(input.EndTimestamp.getTime() / 1000) }),
99
- ...(input.Format != null && { Format: input.Format }),
100
- ...(input.FormatConfig != null && { FormatConfig: se_FormatConfig(input.FormatConfig, context) }),
101
- ...(input.HeightPixels != null && { HeightPixels: input.HeightPixels }),
102
- ...(input.ImageSelectorType != null && { ImageSelectorType: input.ImageSelectorType }),
103
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
104
- ...(input.NextToken != null && { NextToken: input.NextToken }),
105
- ...(input.SamplingInterval != null && { SamplingInterval: input.SamplingInterval }),
106
- ...(input.StartTimestamp != null && { StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) }),
107
- ...(input.StreamARN != null && { StreamARN: input.StreamARN }),
108
- ...(input.StreamName != null && { StreamName: input.StreamName }),
109
- ...(input.WidthPixels != null && { WidthPixels: input.WidthPixels }),
110
- });
89
+ body = JSON.stringify(take(input, {
90
+ EndTimestamp: (_) => Math.round(_.getTime() / 1000),
91
+ Format: [],
92
+ FormatConfig: (_) => _json(_),
93
+ HeightPixels: [],
94
+ ImageSelectorType: [],
95
+ MaxResults: [],
96
+ NextToken: [],
97
+ SamplingInterval: [],
98
+ StartTimestamp: (_) => Math.round(_.getTime() / 1000),
99
+ StreamARN: [],
100
+ StreamName: [],
101
+ WidthPixels: [],
102
+ }));
111
103
  return new __HttpRequest({
112
104
  protocol,
113
105
  hostname,
@@ -125,11 +117,11 @@ export const se_GetMediaForFragmentListCommand = async (input, context) => {
125
117
  };
126
118
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getMediaForFragmentList";
127
119
  let body;
128
- body = JSON.stringify({
129
- ...(input.Fragments != null && { Fragments: se_FragmentNumberList(input.Fragments, context) }),
130
- ...(input.StreamARN != null && { StreamARN: input.StreamARN }),
131
- ...(input.StreamName != null && { StreamName: input.StreamName }),
132
- });
120
+ body = JSON.stringify(take(input, {
121
+ Fragments: (_) => _json(_),
122
+ StreamARN: [],
123
+ StreamName: [],
124
+ }));
133
125
  return new __HttpRequest({
134
126
  protocol,
135
127
  hostname,
@@ -147,13 +139,13 @@ export const se_ListFragmentsCommand = async (input, context) => {
147
139
  };
148
140
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/listFragments";
149
141
  let body;
150
- body = JSON.stringify({
151
- ...(input.FragmentSelector != null && { FragmentSelector: se_FragmentSelector(input.FragmentSelector, context) }),
152
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
153
- ...(input.NextToken != null && { NextToken: input.NextToken }),
154
- ...(input.StreamARN != null && { StreamARN: input.StreamARN }),
155
- ...(input.StreamName != null && { StreamName: input.StreamName }),
156
- });
142
+ body = JSON.stringify(take(input, {
143
+ FragmentSelector: (_) => se_FragmentSelector(_, context),
144
+ MaxResults: [],
145
+ NextToken: [],
146
+ StreamARN: [],
147
+ StreamName: [],
148
+ }));
157
149
  return new __HttpRequest({
158
150
  protocol,
159
151
  hostname,
@@ -213,10 +205,9 @@ const de_GetClipCommandError = async (output, context) => {
213
205
  throw await de_UnsupportedStreamMediaTypeExceptionRes(parsedOutput, context);
214
206
  default:
215
207
  const parsedBody = parsedOutput.body;
216
- throwDefaultError({
208
+ return throwDefaultError({
217
209
  output,
218
210
  parsedBody,
219
- exceptionCtor: __BaseException,
220
211
  errorCode,
221
212
  });
222
213
  }
@@ -229,9 +220,10 @@ export const de_GetDASHStreamingSessionURLCommand = async (output, context) => {
229
220
  $metadata: deserializeMetadata(output),
230
221
  });
231
222
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
232
- if (data.DASHStreamingSessionURL != null) {
233
- contents.DASHStreamingSessionURL = __expectString(data.DASHStreamingSessionURL);
234
- }
223
+ const doc = take(data, {
224
+ DASHStreamingSessionURL: __expectString,
225
+ });
226
+ Object.assign(contents, doc);
235
227
  return contents;
236
228
  };
237
229
  const de_GetDASHStreamingSessionURLCommandError = async (output, context) => {
@@ -267,10 +259,9 @@ const de_GetDASHStreamingSessionURLCommandError = async (output, context) => {
267
259
  throw await de_UnsupportedStreamMediaTypeExceptionRes(parsedOutput, context);
268
260
  default:
269
261
  const parsedBody = parsedOutput.body;
270
- throwDefaultError({
262
+ return throwDefaultError({
271
263
  output,
272
264
  parsedBody,
273
- exceptionCtor: __BaseException,
274
265
  errorCode,
275
266
  });
276
267
  }
@@ -283,9 +274,10 @@ export const de_GetHLSStreamingSessionURLCommand = async (output, context) => {
283
274
  $metadata: deserializeMetadata(output),
284
275
  });
285
276
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
286
- if (data.HLSStreamingSessionURL != null) {
287
- contents.HLSStreamingSessionURL = __expectString(data.HLSStreamingSessionURL);
288
- }
277
+ const doc = take(data, {
278
+ HLSStreamingSessionURL: __expectString,
279
+ });
280
+ Object.assign(contents, doc);
289
281
  return contents;
290
282
  };
291
283
  const de_GetHLSStreamingSessionURLCommandError = async (output, context) => {
@@ -321,10 +313,9 @@ const de_GetHLSStreamingSessionURLCommandError = async (output, context) => {
321
313
  throw await de_UnsupportedStreamMediaTypeExceptionRes(parsedOutput, context);
322
314
  default:
323
315
  const parsedBody = parsedOutput.body;
324
- throwDefaultError({
316
+ return throwDefaultError({
325
317
  output,
326
318
  parsedBody,
327
- exceptionCtor: __BaseException,
328
319
  errorCode,
329
320
  });
330
321
  }
@@ -337,12 +328,11 @@ export const de_GetImagesCommand = async (output, context) => {
337
328
  $metadata: deserializeMetadata(output),
338
329
  });
339
330
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
340
- if (data.Images != null) {
341
- contents.Images = de_Images(data.Images, context);
342
- }
343
- if (data.NextToken != null) {
344
- contents.NextToken = __expectString(data.NextToken);
345
- }
331
+ const doc = take(data, {
332
+ Images: (_) => de_Images(_, context),
333
+ NextToken: __expectString,
334
+ });
335
+ Object.assign(contents, doc);
346
336
  return contents;
347
337
  };
348
338
  const de_GetImagesCommandError = async (output, context) => {
@@ -366,10 +356,9 @@ const de_GetImagesCommandError = async (output, context) => {
366
356
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
367
357
  default:
368
358
  const parsedBody = parsedOutput.body;
369
- throwDefaultError({
359
+ return throwDefaultError({
370
360
  output,
371
361
  parsedBody,
372
- exceptionCtor: __BaseException,
373
362
  errorCode,
374
363
  });
375
364
  }
@@ -408,10 +397,9 @@ const de_GetMediaForFragmentListCommandError = async (output, context) => {
408
397
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
409
398
  default:
410
399
  const parsedBody = parsedOutput.body;
411
- throwDefaultError({
400
+ return throwDefaultError({
412
401
  output,
413
402
  parsedBody,
414
- exceptionCtor: __BaseException,
415
403
  errorCode,
416
404
  });
417
405
  }
@@ -424,12 +412,11 @@ export const de_ListFragmentsCommand = async (output, context) => {
424
412
  $metadata: deserializeMetadata(output),
425
413
  });
426
414
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
427
- if (data.Fragments != null) {
428
- contents.Fragments = de_FragmentList(data.Fragments, context);
429
- }
430
- if (data.NextToken != null) {
431
- contents.NextToken = __expectString(data.NextToken);
432
- }
415
+ const doc = take(data, {
416
+ Fragments: (_) => de_FragmentList(_, context),
417
+ NextToken: __expectString,
418
+ });
419
+ Object.assign(contents, doc);
433
420
  return contents;
434
421
  };
435
422
  const de_ListFragmentsCommandError = async (output, context) => {
@@ -453,21 +440,21 @@ const de_ListFragmentsCommandError = async (output, context) => {
453
440
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
454
441
  default:
455
442
  const parsedBody = parsedOutput.body;
456
- throwDefaultError({
443
+ return throwDefaultError({
457
444
  output,
458
445
  parsedBody,
459
- exceptionCtor: __BaseException,
460
446
  errorCode,
461
447
  });
462
448
  }
463
449
  };
464
- const map = __map;
450
+ const throwDefaultError = withBaseException(__BaseException);
465
451
  const de_ClientLimitExceededExceptionRes = async (parsedOutput, context) => {
466
452
  const contents = map({});
467
453
  const data = parsedOutput.body;
468
- if (data.Message != null) {
469
- contents.Message = __expectString(data.Message);
470
- }
454
+ const doc = take(data, {
455
+ Message: __expectString,
456
+ });
457
+ Object.assign(contents, doc);
471
458
  const exception = new ClientLimitExceededException({
472
459
  $metadata: deserializeMetadata(parsedOutput),
473
460
  ...contents,
@@ -477,9 +464,10 @@ const de_ClientLimitExceededExceptionRes = async (parsedOutput, context) => {
477
464
  const de_InvalidArgumentExceptionRes = async (parsedOutput, context) => {
478
465
  const contents = map({});
479
466
  const data = parsedOutput.body;
480
- if (data.Message != null) {
481
- contents.Message = __expectString(data.Message);
482
- }
467
+ const doc = take(data, {
468
+ Message: __expectString,
469
+ });
470
+ Object.assign(contents, doc);
483
471
  const exception = new InvalidArgumentException({
484
472
  $metadata: deserializeMetadata(parsedOutput),
485
473
  ...contents,
@@ -489,9 +477,10 @@ const de_InvalidArgumentExceptionRes = async (parsedOutput, context) => {
489
477
  const de_InvalidCodecPrivateDataExceptionRes = async (parsedOutput, context) => {
490
478
  const contents = map({});
491
479
  const data = parsedOutput.body;
492
- if (data.Message != null) {
493
- contents.Message = __expectString(data.Message);
494
- }
480
+ const doc = take(data, {
481
+ Message: __expectString,
482
+ });
483
+ Object.assign(contents, doc);
495
484
  const exception = new InvalidCodecPrivateDataException({
496
485
  $metadata: deserializeMetadata(parsedOutput),
497
486
  ...contents,
@@ -501,9 +490,10 @@ const de_InvalidCodecPrivateDataExceptionRes = async (parsedOutput, context) =>
501
490
  const de_InvalidMediaFrameExceptionRes = async (parsedOutput, context) => {
502
491
  const contents = map({});
503
492
  const data = parsedOutput.body;
504
- if (data.Message != null) {
505
- contents.Message = __expectString(data.Message);
506
- }
493
+ const doc = take(data, {
494
+ Message: __expectString,
495
+ });
496
+ Object.assign(contents, doc);
507
497
  const exception = new InvalidMediaFrameException({
508
498
  $metadata: deserializeMetadata(parsedOutput),
509
499
  ...contents,
@@ -513,9 +503,10 @@ const de_InvalidMediaFrameExceptionRes = async (parsedOutput, context) => {
513
503
  const de_MissingCodecPrivateDataExceptionRes = async (parsedOutput, context) => {
514
504
  const contents = map({});
515
505
  const data = parsedOutput.body;
516
- if (data.Message != null) {
517
- contents.Message = __expectString(data.Message);
518
- }
506
+ const doc = take(data, {
507
+ Message: __expectString,
508
+ });
509
+ Object.assign(contents, doc);
519
510
  const exception = new MissingCodecPrivateDataException({
520
511
  $metadata: deserializeMetadata(parsedOutput),
521
512
  ...contents,
@@ -525,9 +516,10 @@ const de_MissingCodecPrivateDataExceptionRes = async (parsedOutput, context) =>
525
516
  const de_NoDataRetentionExceptionRes = async (parsedOutput, context) => {
526
517
  const contents = map({});
527
518
  const data = parsedOutput.body;
528
- if (data.Message != null) {
529
- contents.Message = __expectString(data.Message);
530
- }
519
+ const doc = take(data, {
520
+ Message: __expectString,
521
+ });
522
+ Object.assign(contents, doc);
531
523
  const exception = new NoDataRetentionException({
532
524
  $metadata: deserializeMetadata(parsedOutput),
533
525
  ...contents,
@@ -537,9 +529,10 @@ const de_NoDataRetentionExceptionRes = async (parsedOutput, context) => {
537
529
  const de_NotAuthorizedExceptionRes = async (parsedOutput, context) => {
538
530
  const contents = map({});
539
531
  const data = parsedOutput.body;
540
- if (data.Message != null) {
541
- contents.Message = __expectString(data.Message);
542
- }
532
+ const doc = take(data, {
533
+ Message: __expectString,
534
+ });
535
+ Object.assign(contents, doc);
543
536
  const exception = new NotAuthorizedException({
544
537
  $metadata: deserializeMetadata(parsedOutput),
545
538
  ...contents,
@@ -549,9 +542,10 @@ const de_NotAuthorizedExceptionRes = async (parsedOutput, context) => {
549
542
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
550
543
  const contents = map({});
551
544
  const data = parsedOutput.body;
552
- if (data.Message != null) {
553
- contents.Message = __expectString(data.Message);
554
- }
545
+ const doc = take(data, {
546
+ Message: __expectString,
547
+ });
548
+ Object.assign(contents, doc);
555
549
  const exception = new ResourceNotFoundException({
556
550
  $metadata: deserializeMetadata(parsedOutput),
557
551
  ...contents,
@@ -561,9 +555,10 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
561
555
  const de_UnsupportedStreamMediaTypeExceptionRes = async (parsedOutput, context) => {
562
556
  const contents = map({});
563
557
  const data = parsedOutput.body;
564
- if (data.Message != null) {
565
- contents.Message = __expectString(data.Message);
566
- }
558
+ const doc = take(data, {
559
+ Message: __expectString,
560
+ });
561
+ Object.assign(contents, doc);
567
562
  const exception = new UnsupportedStreamMediaTypeException({
568
563
  $metadata: deserializeMetadata(parsedOutput),
569
564
  ...contents,
@@ -571,107 +566,81 @@ const de_UnsupportedStreamMediaTypeExceptionRes = async (parsedOutput, context)
571
566
  return __decorateServiceException(exception, parsedOutput.body);
572
567
  };
573
568
  const se_ClipFragmentSelector = (input, context) => {
574
- return {
575
- ...(input.FragmentSelectorType != null && { FragmentSelectorType: input.FragmentSelectorType }),
576
- ...(input.TimestampRange != null && { TimestampRange: se_ClipTimestampRange(input.TimestampRange, context) }),
577
- };
569
+ return take(input, {
570
+ FragmentSelectorType: [],
571
+ TimestampRange: (_) => se_ClipTimestampRange(_, context),
572
+ });
578
573
  };
579
574
  const se_ClipTimestampRange = (input, context) => {
580
- return {
581
- ...(input.EndTimestamp != null && { EndTimestamp: Math.round(input.EndTimestamp.getTime() / 1000) }),
582
- ...(input.StartTimestamp != null && { StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) }),
583
- };
575
+ return take(input, {
576
+ EndTimestamp: (_) => Math.round(_.getTime() / 1000),
577
+ StartTimestamp: (_) => Math.round(_.getTime() / 1000),
578
+ });
584
579
  };
585
580
  const se_DASHFragmentSelector = (input, context) => {
586
- return {
587
- ...(input.FragmentSelectorType != null && { FragmentSelectorType: input.FragmentSelectorType }),
588
- ...(input.TimestampRange != null && { TimestampRange: se_DASHTimestampRange(input.TimestampRange, context) }),
589
- };
581
+ return take(input, {
582
+ FragmentSelectorType: [],
583
+ TimestampRange: (_) => se_DASHTimestampRange(_, context),
584
+ });
590
585
  };
591
586
  const se_DASHTimestampRange = (input, context) => {
592
- return {
593
- ...(input.EndTimestamp != null && { EndTimestamp: Math.round(input.EndTimestamp.getTime() / 1000) }),
594
- ...(input.StartTimestamp != null && { StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) }),
595
- };
596
- };
597
- const se_FormatConfig = (input, context) => {
598
- return Object.entries(input).reduce((acc, [key, value]) => {
599
- if (value === null) {
600
- return acc;
601
- }
602
- acc[key] = value;
603
- return acc;
604
- }, {});
605
- };
606
- const se_FragmentNumberList = (input, context) => {
607
- return input
608
- .filter((e) => e != null)
609
- .map((entry) => {
610
- return entry;
587
+ return take(input, {
588
+ EndTimestamp: (_) => Math.round(_.getTime() / 1000),
589
+ StartTimestamp: (_) => Math.round(_.getTime() / 1000),
611
590
  });
612
591
  };
613
592
  const se_FragmentSelector = (input, context) => {
614
- return {
615
- ...(input.FragmentSelectorType != null && { FragmentSelectorType: input.FragmentSelectorType }),
616
- ...(input.TimestampRange != null && { TimestampRange: se_TimestampRange(input.TimestampRange, context) }),
617
- };
593
+ return take(input, {
594
+ FragmentSelectorType: [],
595
+ TimestampRange: (_) => se_TimestampRange(_, context),
596
+ });
618
597
  };
619
598
  const se_HLSFragmentSelector = (input, context) => {
620
- return {
621
- ...(input.FragmentSelectorType != null && { FragmentSelectorType: input.FragmentSelectorType }),
622
- ...(input.TimestampRange != null && { TimestampRange: se_HLSTimestampRange(input.TimestampRange, context) }),
623
- };
599
+ return take(input, {
600
+ FragmentSelectorType: [],
601
+ TimestampRange: (_) => se_HLSTimestampRange(_, context),
602
+ });
624
603
  };
625
604
  const se_HLSTimestampRange = (input, context) => {
626
- return {
627
- ...(input.EndTimestamp != null && { EndTimestamp: Math.round(input.EndTimestamp.getTime() / 1000) }),
628
- ...(input.StartTimestamp != null && { StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) }),
629
- };
605
+ return take(input, {
606
+ EndTimestamp: (_) => Math.round(_.getTime() / 1000),
607
+ StartTimestamp: (_) => Math.round(_.getTime() / 1000),
608
+ });
630
609
  };
631
610
  const se_TimestampRange = (input, context) => {
632
- return {
633
- ...(input.EndTimestamp != null && { EndTimestamp: Math.round(input.EndTimestamp.getTime() / 1000) }),
634
- ...(input.StartTimestamp != null && { StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) }),
635
- };
611
+ return take(input, {
612
+ EndTimestamp: (_) => Math.round(_.getTime() / 1000),
613
+ StartTimestamp: (_) => Math.round(_.getTime() / 1000),
614
+ });
636
615
  };
637
616
  const de_Fragment = (output, context) => {
638
- return {
639
- FragmentLengthInMilliseconds: __expectLong(output.FragmentLengthInMilliseconds),
640
- FragmentNumber: __expectString(output.FragmentNumber),
641
- FragmentSizeInBytes: __expectLong(output.FragmentSizeInBytes),
642
- ProducerTimestamp: output.ProducerTimestamp != null
643
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.ProducerTimestamp)))
644
- : undefined,
645
- ServerTimestamp: output.ServerTimestamp != null
646
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.ServerTimestamp)))
647
- : undefined,
648
- };
617
+ return take(output, {
618
+ FragmentLengthInMilliseconds: __expectLong,
619
+ FragmentNumber: __expectString,
620
+ FragmentSizeInBytes: __expectLong,
621
+ ProducerTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
622
+ ServerTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
623
+ });
649
624
  };
650
625
  const de_FragmentList = (output, context) => {
651
626
  const retVal = (output || [])
652
627
  .filter((e) => e != null)
653
628
  .map((entry) => {
654
- if (entry === null) {
655
- return null;
656
- }
657
629
  return de_Fragment(entry, context);
658
630
  });
659
631
  return retVal;
660
632
  };
661
633
  const de_Image = (output, context) => {
662
- return {
663
- Error: __expectString(output.Error),
664
- ImageContent: __expectString(output.ImageContent),
665
- TimeStamp: output.TimeStamp != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.TimeStamp))) : undefined,
666
- };
634
+ return take(output, {
635
+ Error: __expectString,
636
+ ImageContent: __expectString,
637
+ TimeStamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
638
+ });
667
639
  };
668
640
  const de_Images = (output, context) => {
669
641
  const retVal = (output || [])
670
642
  .filter((e) => e != null)
671
643
  .map((entry) => {
672
- if (entry === null) {
673
- return null;
674
- }
675
644
  return de_Image(entry, context);
676
645
  });
677
646
  return retVal;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-kinesis-video-archived-media",
3
3
  "description": "AWS SDK for JavaScript Kinesis Video Archived Media Client for Node.js, Browser and React Native",
4
- "version": "3.310.0",
4
+ "version": "3.315.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -21,9 +21,9 @@
21
21
  "dependencies": {
22
22
  "@aws-crypto/sha256-browser": "3.0.0",
23
23
  "@aws-crypto/sha256-js": "3.0.0",
24
- "@aws-sdk/client-sts": "3.310.0",
24
+ "@aws-sdk/client-sts": "3.315.0",
25
25
  "@aws-sdk/config-resolver": "3.310.0",
26
- "@aws-sdk/credential-provider-node": "3.310.0",
26
+ "@aws-sdk/credential-provider-node": "3.315.0",
27
27
  "@aws-sdk/fetch-http-handler": "3.310.0",
28
28
  "@aws-sdk/hash-node": "3.310.0",
29
29
  "@aws-sdk/invalid-dependency": "3.310.0",
@@ -40,14 +40,14 @@
40
40
  "@aws-sdk/node-config-provider": "3.310.0",
41
41
  "@aws-sdk/node-http-handler": "3.310.0",
42
42
  "@aws-sdk/protocol-http": "3.310.0",
43
- "@aws-sdk/smithy-client": "3.310.0",
43
+ "@aws-sdk/smithy-client": "3.315.0",
44
44
  "@aws-sdk/types": "3.310.0",
45
45
  "@aws-sdk/url-parser": "3.310.0",
46
46
  "@aws-sdk/util-base64": "3.310.0",
47
47
  "@aws-sdk/util-body-length-browser": "3.310.0",
48
48
  "@aws-sdk/util-body-length-node": "3.310.0",
49
- "@aws-sdk/util-defaults-mode-browser": "3.310.0",
50
- "@aws-sdk/util-defaults-mode-node": "3.310.0",
49
+ "@aws-sdk/util-defaults-mode-browser": "3.315.0",
50
+ "@aws-sdk/util-defaults-mode-node": "3.315.0",
51
51
  "@aws-sdk/util-endpoints": "3.310.0",
52
52
  "@aws-sdk/util-retry": "3.310.0",
53
53
  "@aws-sdk/util-stream-browser": "3.310.0",