@aws-sdk/client-rekognitionstreaming 3.312.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.
@@ -7,7 +7,7 @@ const models_0_1 = require("../models/models_0");
7
7
  const RekognitionStreamingServiceException_1 = require("../models/RekognitionStreamingServiceException");
8
8
  const se_StartFaceLivenessSessionCommand = async (input, context) => {
9
9
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
10
- const headers = map({}, isSerializableHeaderValue, {
10
+ const headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
11
11
  "x-amz-rekognition-streaming-liveness-session-id": input.SessionId,
12
12
  "x-amz-rekognition-streaming-liveness-video-width": input.VideoWidth,
13
13
  "x-amz-rekognition-streaming-liveness-video-height": input.VideoHeight,
@@ -33,7 +33,7 @@ const de_StartFaceLivenessSessionCommand = async (output, context) => {
33
33
  if (output.statusCode !== 200 && output.statusCode >= 300) {
34
34
  return de_StartFaceLivenessSessionCommandError(output, context);
35
35
  }
36
- const contents = map({
36
+ const contents = (0, smithy_client_1.map)({
37
37
  $metadata: deserializeMetadata(output),
38
38
  SessionId: [, output.headers["x-amz-rekognition-streaming-liveness-session-id"]],
39
39
  });
@@ -72,24 +72,22 @@ const de_StartFaceLivenessSessionCommandError = async (output, context) => {
72
72
  throw await de_ValidationExceptionRes(parsedOutput, context);
73
73
  default:
74
74
  const parsedBody = parsedOutput.body;
75
- (0, smithy_client_1.throwDefaultError)({
75
+ return throwDefaultError({
76
76
  output,
77
77
  parsedBody,
78
- exceptionCtor: RekognitionStreamingServiceException_1.RekognitionStreamingServiceException,
79
78
  errorCode,
80
79
  });
81
80
  }
82
81
  };
83
- const map = smithy_client_1.map;
82
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(RekognitionStreamingServiceException_1.RekognitionStreamingServiceException);
84
83
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
85
- const contents = map({});
84
+ const contents = (0, smithy_client_1.map)({});
86
85
  const data = parsedOutput.body;
87
- if (data.Code != null) {
88
- contents.Code = (0, smithy_client_1.expectString)(data.Code);
89
- }
90
- if (data.Message != null) {
91
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
92
- }
86
+ const doc = (0, smithy_client_1.take)(data, {
87
+ Code: smithy_client_1.expectString,
88
+ Message: smithy_client_1.expectString,
89
+ });
90
+ Object.assign(contents, doc);
93
91
  const exception = new models_0_1.AccessDeniedException({
94
92
  $metadata: deserializeMetadata(parsedOutput),
95
93
  ...contents,
@@ -97,14 +95,13 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
97
95
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
98
96
  };
99
97
  const de_InternalServerExceptionRes = async (parsedOutput, context) => {
100
- const contents = map({});
98
+ const contents = (0, smithy_client_1.map)({});
101
99
  const data = parsedOutput.body;
102
- if (data.Code != null) {
103
- contents.Code = (0, smithy_client_1.expectString)(data.Code);
104
- }
105
- if (data.Message != null) {
106
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
107
- }
100
+ const doc = (0, smithy_client_1.take)(data, {
101
+ Code: smithy_client_1.expectString,
102
+ Message: smithy_client_1.expectString,
103
+ });
104
+ Object.assign(contents, doc);
108
105
  const exception = new models_0_1.InternalServerException({
109
106
  $metadata: deserializeMetadata(parsedOutput),
110
107
  ...contents,
@@ -112,14 +109,13 @@ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
112
109
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
113
110
  };
114
111
  const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
115
- const contents = map({});
112
+ const contents = (0, smithy_client_1.map)({});
116
113
  const data = parsedOutput.body;
117
- if (data.Code != null) {
118
- contents.Code = (0, smithy_client_1.expectString)(data.Code);
119
- }
120
- if (data.Message != null) {
121
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
122
- }
114
+ const doc = (0, smithy_client_1.take)(data, {
115
+ Code: smithy_client_1.expectString,
116
+ Message: smithy_client_1.expectString,
117
+ });
118
+ Object.assign(contents, doc);
123
119
  const exception = new models_0_1.ServiceQuotaExceededException({
124
120
  $metadata: deserializeMetadata(parsedOutput),
125
121
  ...contents,
@@ -127,14 +123,13 @@ const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
127
123
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
128
124
  };
129
125
  const de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
130
- const contents = map({});
126
+ const contents = (0, smithy_client_1.map)({});
131
127
  const data = parsedOutput.body;
132
- if (data.Code != null) {
133
- contents.Code = (0, smithy_client_1.expectString)(data.Code);
134
- }
135
- if (data.Message != null) {
136
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
137
- }
128
+ const doc = (0, smithy_client_1.take)(data, {
129
+ Code: smithy_client_1.expectString,
130
+ Message: smithy_client_1.expectString,
131
+ });
132
+ Object.assign(contents, doc);
138
133
  const exception = new models_0_1.ServiceUnavailableException({
139
134
  $metadata: deserializeMetadata(parsedOutput),
140
135
  ...contents,
@@ -142,14 +137,13 @@ const de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
142
137
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
143
138
  };
144
139
  const de_SessionNotFoundExceptionRes = async (parsedOutput, context) => {
145
- const contents = map({});
140
+ const contents = (0, smithy_client_1.map)({});
146
141
  const data = parsedOutput.body;
147
- if (data.Code != null) {
148
- contents.Code = (0, smithy_client_1.expectString)(data.Code);
149
- }
150
- if (data.Message != null) {
151
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
152
- }
142
+ const doc = (0, smithy_client_1.take)(data, {
143
+ Code: smithy_client_1.expectString,
144
+ Message: smithy_client_1.expectString,
145
+ });
146
+ Object.assign(contents, doc);
153
147
  const exception = new models_0_1.SessionNotFoundException({
154
148
  $metadata: deserializeMetadata(parsedOutput),
155
149
  ...contents,
@@ -157,14 +151,13 @@ const de_SessionNotFoundExceptionRes = async (parsedOutput, context) => {
157
151
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
158
152
  };
159
153
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
160
- const contents = map({});
154
+ const contents = (0, smithy_client_1.map)({});
161
155
  const data = parsedOutput.body;
162
- if (data.Code != null) {
163
- contents.Code = (0, smithy_client_1.expectString)(data.Code);
164
- }
165
- if (data.Message != null) {
166
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
167
- }
156
+ const doc = (0, smithy_client_1.take)(data, {
157
+ Code: smithy_client_1.expectString,
158
+ Message: smithy_client_1.expectString,
159
+ });
160
+ Object.assign(contents, doc);
168
161
  const exception = new models_0_1.ThrottlingException({
169
162
  $metadata: deserializeMetadata(parsedOutput),
170
163
  ...contents,
@@ -172,14 +165,13 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
172
165
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
173
166
  };
174
167
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
175
- const contents = map({});
168
+ const contents = (0, smithy_client_1.map)({});
176
169
  const data = parsedOutput.body;
177
- if (data.Code != null) {
178
- contents.Code = (0, smithy_client_1.expectString)(data.Code);
179
- }
180
- if (data.Message != null) {
181
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
182
- }
170
+ const doc = (0, smithy_client_1.take)(data, {
171
+ Code: smithy_client_1.expectString,
172
+ Message: smithy_client_1.expectString,
173
+ });
174
+ Object.assign(contents, doc);
183
175
  const exception = new models_0_1.ValidationException({
184
176
  $metadata: deserializeMetadata(parsedOutput),
185
177
  ...contents,
@@ -259,7 +251,7 @@ const de_LivenessResponseStream = (output, context) => {
259
251
  const de_DisconnectionEvent_event = async (output, context) => {
260
252
  const contents = {};
261
253
  const data = await parseBody(output.body, context);
262
- Object.assign(contents, de_DisconnectionEvent(data, context));
254
+ Object.assign(contents, (0, smithy_client_1._json)(data));
263
255
  return contents;
264
256
  };
265
257
  const de_InternalServerException_event = async (output, context) => {
@@ -304,12 +296,12 @@ const de_ValidationException_event = async (output, context) => {
304
296
  return de_ValidationExceptionRes(parsedOutput, context);
305
297
  };
306
298
  const se_BoundingBox = (input, context) => {
307
- return {
308
- ...(input.Height != null && { Height: (0, smithy_client_1.serializeFloat)(input.Height) }),
309
- ...(input.Left != null && { Left: (0, smithy_client_1.serializeFloat)(input.Left) }),
310
- ...(input.Top != null && { Top: (0, smithy_client_1.serializeFloat)(input.Top) }),
311
- ...(input.Width != null && { Width: (0, smithy_client_1.serializeFloat)(input.Width) }),
312
- };
299
+ return (0, smithy_client_1.take)(input, {
300
+ Height: smithy_client_1.serializeFloat,
301
+ Left: smithy_client_1.serializeFloat,
302
+ Top: smithy_client_1.serializeFloat,
303
+ Width: smithy_client_1.serializeFloat,
304
+ });
313
305
  };
314
306
  const se_ClientChallenge = (input, context) => {
315
307
  return models_0_1.ClientChallenge.visit(input, {
@@ -320,133 +312,83 @@ const se_ClientChallenge = (input, context) => {
320
312
  });
321
313
  };
322
314
  const se_ClientSessionInformationEvent = (input, context) => {
323
- return {
324
- ...(input.Challenge != null && { Challenge: se_ClientChallenge(input.Challenge, context) }),
325
- };
326
- };
327
- const se_ColorComponentList = (input, context) => {
328
- return input
329
- .filter((e) => e != null)
330
- .map((entry) => {
331
- return entry;
315
+ return (0, smithy_client_1.take)(input, {
316
+ Challenge: (_) => se_ClientChallenge(_, context),
332
317
  });
333
318
  };
334
- const se_ColorDisplayed = (input, context) => {
335
- return {
336
- ...(input.CurrentColor != null && { CurrentColor: se_FreshnessColor(input.CurrentColor, context) }),
337
- ...(input.CurrentColorStartTimestamp != null && { CurrentColorStartTimestamp: input.CurrentColorStartTimestamp }),
338
- ...(input.PreviousColor != null && { PreviousColor: se_FreshnessColor(input.PreviousColor, context) }),
339
- ...(input.SequenceNumber != null && { SequenceNumber: input.SequenceNumber }),
340
- };
341
- };
342
319
  const se_FaceMovementAndLightClientChallenge = (input, context) => {
343
- return {
344
- ...(input.ChallengeId != null && { ChallengeId: input.ChallengeId }),
345
- ...(input.ColorDisplayed != null && { ColorDisplayed: se_ColorDisplayed(input.ColorDisplayed, context) }),
346
- ...(input.InitialFace != null && { InitialFace: se_InitialFace(input.InitialFace, context) }),
347
- ...(input.TargetFace != null && { TargetFace: se_TargetFace(input.TargetFace, context) }),
348
- ...(input.VideoEndTimestamp != null && { VideoEndTimestamp: input.VideoEndTimestamp }),
349
- ...(input.VideoStartTimestamp != null && { VideoStartTimestamp: input.VideoStartTimestamp }),
350
- };
351
- };
352
- const se_FreshnessColor = (input, context) => {
353
- return {
354
- ...(input.RGB != null && { RGB: se_ColorComponentList(input.RGB, context) }),
355
- };
320
+ return (0, smithy_client_1.take)(input, {
321
+ ChallengeId: [],
322
+ ColorDisplayed: smithy_client_1._json,
323
+ InitialFace: (_) => se_InitialFace(_, context),
324
+ TargetFace: (_) => se_TargetFace(_, context),
325
+ VideoEndTimestamp: [],
326
+ VideoStartTimestamp: [],
327
+ });
356
328
  };
357
329
  const se_InitialFace = (input, context) => {
358
- return {
359
- ...(input.BoundingBox != null && { BoundingBox: se_BoundingBox(input.BoundingBox, context) }),
360
- ...(input.InitialFaceDetectedTimestamp != null && {
361
- InitialFaceDetectedTimestamp: input.InitialFaceDetectedTimestamp,
362
- }),
363
- };
330
+ return (0, smithy_client_1.take)(input, {
331
+ BoundingBox: (_) => se_BoundingBox(_, context),
332
+ InitialFaceDetectedTimestamp: [],
333
+ });
364
334
  };
365
335
  const se_TargetFace = (input, context) => {
366
- return {
367
- ...(input.BoundingBox != null && { BoundingBox: se_BoundingBox(input.BoundingBox, context) }),
368
- ...(input.FaceDetectedInTargetPositionEndTimestamp != null && {
369
- FaceDetectedInTargetPositionEndTimestamp: input.FaceDetectedInTargetPositionEndTimestamp,
370
- }),
371
- ...(input.FaceDetectedInTargetPositionStartTimestamp != null && {
372
- FaceDetectedInTargetPositionStartTimestamp: input.FaceDetectedInTargetPositionStartTimestamp,
373
- }),
374
- };
336
+ return (0, smithy_client_1.take)(input, {
337
+ BoundingBox: (_) => se_BoundingBox(_, context),
338
+ FaceDetectedInTargetPositionEndTimestamp: [],
339
+ FaceDetectedInTargetPositionStartTimestamp: [],
340
+ });
375
341
  };
376
342
  const se_VideoEvent = (input, context) => {
377
- return {
378
- ...(input.TimestampMillis != null && { TimestampMillis: input.TimestampMillis }),
379
- ...(input.VideoChunk != null && { VideoChunk: context.base64Encoder(input.VideoChunk) }),
380
- };
343
+ return (0, smithy_client_1.take)(input, {
344
+ TimestampMillis: [],
345
+ VideoChunk: context.base64Encoder,
346
+ });
381
347
  };
382
348
  const de_ChallengeConfig = (output, context) => {
383
- return {
384
- BlazeFaceDetectionThreshold: (0, smithy_client_1.limitedParseFloat32)(output.BlazeFaceDetectionThreshold),
385
- FaceDistanceThreshold: (0, smithy_client_1.limitedParseFloat32)(output.FaceDistanceThreshold),
386
- FaceDistanceThresholdMax: (0, smithy_client_1.limitedParseFloat32)(output.FaceDistanceThresholdMax),
387
- FaceDistanceThresholdMin: (0, smithy_client_1.limitedParseFloat32)(output.FaceDistanceThresholdMin),
388
- FaceIouHeightThreshold: (0, smithy_client_1.limitedParseFloat32)(output.FaceIouHeightThreshold),
389
- FaceIouWidthThreshold: (0, smithy_client_1.limitedParseFloat32)(output.FaceIouWidthThreshold),
390
- OvalHeightWidthRatio: (0, smithy_client_1.limitedParseFloat32)(output.OvalHeightWidthRatio),
391
- OvalIouHeightThreshold: (0, smithy_client_1.limitedParseFloat32)(output.OvalIouHeightThreshold),
392
- OvalIouThreshold: (0, smithy_client_1.limitedParseFloat32)(output.OvalIouThreshold),
393
- OvalIouWidthThreshold: (0, smithy_client_1.limitedParseFloat32)(output.OvalIouWidthThreshold),
394
- };
395
- };
396
- const de_ColorComponentList = (output, context) => {
397
- const retVal = (output || [])
398
- .filter((e) => e != null)
399
- .map((entry) => {
400
- if (entry === null) {
401
- return null;
402
- }
403
- return (0, smithy_client_1.expectInt32)(entry);
349
+ return (0, smithy_client_1.take)(output, {
350
+ BlazeFaceDetectionThreshold: smithy_client_1.limitedParseFloat32,
351
+ FaceDistanceThreshold: smithy_client_1.limitedParseFloat32,
352
+ FaceDistanceThresholdMax: smithy_client_1.limitedParseFloat32,
353
+ FaceDistanceThresholdMin: smithy_client_1.limitedParseFloat32,
354
+ FaceIouHeightThreshold: smithy_client_1.limitedParseFloat32,
355
+ FaceIouWidthThreshold: smithy_client_1.limitedParseFloat32,
356
+ OvalHeightWidthRatio: smithy_client_1.limitedParseFloat32,
357
+ OvalIouHeightThreshold: smithy_client_1.limitedParseFloat32,
358
+ OvalIouThreshold: smithy_client_1.limitedParseFloat32,
359
+ OvalIouWidthThreshold: smithy_client_1.limitedParseFloat32,
404
360
  });
405
- return retVal;
406
361
  };
407
362
  const de_ColorSequence = (output, context) => {
408
- return {
409
- DownscrollDuration: (0, smithy_client_1.limitedParseFloat32)(output.DownscrollDuration),
410
- FlatDisplayDuration: (0, smithy_client_1.limitedParseFloat32)(output.FlatDisplayDuration),
411
- FreshnessColor: output.FreshnessColor != null ? de_FreshnessColor(output.FreshnessColor, context) : undefined,
412
- };
363
+ return (0, smithy_client_1.take)(output, {
364
+ DownscrollDuration: smithy_client_1.limitedParseFloat32,
365
+ FlatDisplayDuration: smithy_client_1.limitedParseFloat32,
366
+ FreshnessColor: smithy_client_1._json,
367
+ });
413
368
  };
414
369
  const de_ColorSequences = (output, context) => {
415
370
  const retVal = (output || [])
416
371
  .filter((e) => e != null)
417
372
  .map((entry) => {
418
- if (entry === null) {
419
- return null;
420
- }
421
373
  return de_ColorSequence(entry, context);
422
374
  });
423
375
  return retVal;
424
376
  };
425
- const de_DisconnectionEvent = (output, context) => {
426
- return {
427
- TimestampMillis: (0, smithy_client_1.expectLong)(output.TimestampMillis),
428
- };
429
- };
430
377
  const de_FaceMovementAndLightServerChallenge = (output, context) => {
431
- return {
432
- ChallengeConfig: output.ChallengeConfig != null ? de_ChallengeConfig(output.ChallengeConfig, context) : undefined,
433
- ColorSequences: output.ColorSequences != null ? de_ColorSequences(output.ColorSequences, context) : undefined,
434
- LightChallengeType: (0, smithy_client_1.expectString)(output.LightChallengeType),
435
- OvalParameters: output.OvalParameters != null ? de_OvalParameters(output.OvalParameters, context) : undefined,
436
- };
437
- };
438
- const de_FreshnessColor = (output, context) => {
439
- return {
440
- RGB: output.RGB != null ? de_ColorComponentList(output.RGB, context) : undefined,
441
- };
378
+ return (0, smithy_client_1.take)(output, {
379
+ ChallengeConfig: (_) => de_ChallengeConfig(_, context),
380
+ ColorSequences: (_) => de_ColorSequences(_, context),
381
+ LightChallengeType: smithy_client_1.expectString,
382
+ OvalParameters: (_) => de_OvalParameters(_, context),
383
+ });
442
384
  };
443
385
  const de_OvalParameters = (output, context) => {
444
- return {
445
- CenterX: (0, smithy_client_1.limitedParseFloat32)(output.CenterX),
446
- CenterY: (0, smithy_client_1.limitedParseFloat32)(output.CenterY),
447
- Height: (0, smithy_client_1.limitedParseFloat32)(output.Height),
448
- Width: (0, smithy_client_1.limitedParseFloat32)(output.Width),
449
- };
386
+ return (0, smithy_client_1.take)(output, {
387
+ CenterX: smithy_client_1.limitedParseFloat32,
388
+ CenterY: smithy_client_1.limitedParseFloat32,
389
+ Height: smithy_client_1.limitedParseFloat32,
390
+ Width: smithy_client_1.limitedParseFloat32,
391
+ });
450
392
  };
451
393
  const de_ServerChallenge = (output, context) => {
452
394
  if (output.FaceMovementAndLightChallenge != null) {
@@ -457,14 +399,14 @@ const de_ServerChallenge = (output, context) => {
457
399
  return { $unknown: Object.entries(output)[0] };
458
400
  };
459
401
  const de_ServerSessionInformationEvent = (output, context) => {
460
- return {
461
- SessionInformation: output.SessionInformation != null ? de_SessionInformation(output.SessionInformation, context) : undefined,
462
- };
402
+ return (0, smithy_client_1.take)(output, {
403
+ SessionInformation: (_) => de_SessionInformation(_, context),
404
+ });
463
405
  };
464
406
  const de_SessionInformation = (output, context) => {
465
- return {
466
- Challenge: output.Challenge != null ? de_ServerChallenge((0, smithy_client_1.expectUnion)(output.Challenge), context) : undefined,
467
- };
407
+ return (0, smithy_client_1.take)(output, {
408
+ Challenge: (_) => de_ServerChallenge((0, smithy_client_1.expectUnion)(_), context),
409
+ });
468
410
  };
469
411
  const deserializeMetadata = (output) => ({
470
412
  httpStatusCode: output.statusCode,
@@ -1,5 +1,5 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, expectString as __expectString, expectUnion as __expectUnion, limitedParseFloat32 as __limitedParseFloat32, map as __map, serializeFloat as __serializeFloat, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectString as __expectString, expectUnion as __expectUnion, limitedParseFloat32 as __limitedParseFloat32, map, serializeFloat as __serializeFloat, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { AccessDeniedException, ClientChallenge, InternalServerException, LivenessRequestStream, ServiceQuotaExceededException, ServiceUnavailableException, SessionNotFoundException, ThrottlingException, ValidationException, } from "../models/models_0";
4
4
  import { RekognitionStreamingServiceException as __BaseException } from "../models/RekognitionStreamingServiceException";
5
5
  export const se_StartFaceLivenessSessionCommand = async (input, context) => {
@@ -67,24 +67,22 @@ const de_StartFaceLivenessSessionCommandError = async (output, context) => {
67
67
  throw await de_ValidationExceptionRes(parsedOutput, context);
68
68
  default:
69
69
  const parsedBody = parsedOutput.body;
70
- throwDefaultError({
70
+ return throwDefaultError({
71
71
  output,
72
72
  parsedBody,
73
- exceptionCtor: __BaseException,
74
73
  errorCode,
75
74
  });
76
75
  }
77
76
  };
78
- const map = __map;
77
+ const throwDefaultError = withBaseException(__BaseException);
79
78
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
80
79
  const contents = map({});
81
80
  const data = parsedOutput.body;
82
- if (data.Code != null) {
83
- contents.Code = __expectString(data.Code);
84
- }
85
- if (data.Message != null) {
86
- contents.Message = __expectString(data.Message);
87
- }
81
+ const doc = take(data, {
82
+ Code: __expectString,
83
+ Message: __expectString,
84
+ });
85
+ Object.assign(contents, doc);
88
86
  const exception = new AccessDeniedException({
89
87
  $metadata: deserializeMetadata(parsedOutput),
90
88
  ...contents,
@@ -94,12 +92,11 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
94
92
  const de_InternalServerExceptionRes = async (parsedOutput, context) => {
95
93
  const contents = map({});
96
94
  const data = parsedOutput.body;
97
- if (data.Code != null) {
98
- contents.Code = __expectString(data.Code);
99
- }
100
- if (data.Message != null) {
101
- contents.Message = __expectString(data.Message);
102
- }
95
+ const doc = take(data, {
96
+ Code: __expectString,
97
+ Message: __expectString,
98
+ });
99
+ Object.assign(contents, doc);
103
100
  const exception = new InternalServerException({
104
101
  $metadata: deserializeMetadata(parsedOutput),
105
102
  ...contents,
@@ -109,12 +106,11 @@ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
109
106
  const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
110
107
  const contents = map({});
111
108
  const data = parsedOutput.body;
112
- if (data.Code != null) {
113
- contents.Code = __expectString(data.Code);
114
- }
115
- if (data.Message != null) {
116
- contents.Message = __expectString(data.Message);
117
- }
109
+ const doc = take(data, {
110
+ Code: __expectString,
111
+ Message: __expectString,
112
+ });
113
+ Object.assign(contents, doc);
118
114
  const exception = new ServiceQuotaExceededException({
119
115
  $metadata: deserializeMetadata(parsedOutput),
120
116
  ...contents,
@@ -124,12 +120,11 @@ const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
124
120
  const de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
125
121
  const contents = map({});
126
122
  const data = parsedOutput.body;
127
- if (data.Code != null) {
128
- contents.Code = __expectString(data.Code);
129
- }
130
- if (data.Message != null) {
131
- contents.Message = __expectString(data.Message);
132
- }
123
+ const doc = take(data, {
124
+ Code: __expectString,
125
+ Message: __expectString,
126
+ });
127
+ Object.assign(contents, doc);
133
128
  const exception = new ServiceUnavailableException({
134
129
  $metadata: deserializeMetadata(parsedOutput),
135
130
  ...contents,
@@ -139,12 +134,11 @@ const de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
139
134
  const de_SessionNotFoundExceptionRes = async (parsedOutput, context) => {
140
135
  const contents = map({});
141
136
  const data = parsedOutput.body;
142
- if (data.Code != null) {
143
- contents.Code = __expectString(data.Code);
144
- }
145
- if (data.Message != null) {
146
- contents.Message = __expectString(data.Message);
147
- }
137
+ const doc = take(data, {
138
+ Code: __expectString,
139
+ Message: __expectString,
140
+ });
141
+ Object.assign(contents, doc);
148
142
  const exception = new SessionNotFoundException({
149
143
  $metadata: deserializeMetadata(parsedOutput),
150
144
  ...contents,
@@ -154,12 +148,11 @@ const de_SessionNotFoundExceptionRes = async (parsedOutput, context) => {
154
148
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
155
149
  const contents = map({});
156
150
  const data = parsedOutput.body;
157
- if (data.Code != null) {
158
- contents.Code = __expectString(data.Code);
159
- }
160
- if (data.Message != null) {
161
- contents.Message = __expectString(data.Message);
162
- }
151
+ const doc = take(data, {
152
+ Code: __expectString,
153
+ Message: __expectString,
154
+ });
155
+ Object.assign(contents, doc);
163
156
  const exception = new ThrottlingException({
164
157
  $metadata: deserializeMetadata(parsedOutput),
165
158
  ...contents,
@@ -169,12 +162,11 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
169
162
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
170
163
  const contents = map({});
171
164
  const data = parsedOutput.body;
172
- if (data.Code != null) {
173
- contents.Code = __expectString(data.Code);
174
- }
175
- if (data.Message != null) {
176
- contents.Message = __expectString(data.Message);
177
- }
165
+ const doc = take(data, {
166
+ Code: __expectString,
167
+ Message: __expectString,
168
+ });
169
+ Object.assign(contents, doc);
178
170
  const exception = new ValidationException({
179
171
  $metadata: deserializeMetadata(parsedOutput),
180
172
  ...contents,
@@ -254,7 +246,7 @@ const de_LivenessResponseStream = (output, context) => {
254
246
  const de_DisconnectionEvent_event = async (output, context) => {
255
247
  const contents = {};
256
248
  const data = await parseBody(output.body, context);
257
- Object.assign(contents, de_DisconnectionEvent(data, context));
249
+ Object.assign(contents, _json(data));
258
250
  return contents;
259
251
  };
260
252
  const de_InternalServerException_event = async (output, context) => {
@@ -299,12 +291,12 @@ const de_ValidationException_event = async (output, context) => {
299
291
  return de_ValidationExceptionRes(parsedOutput, context);
300
292
  };
301
293
  const se_BoundingBox = (input, context) => {
302
- return {
303
- ...(input.Height != null && { Height: __serializeFloat(input.Height) }),
304
- ...(input.Left != null && { Left: __serializeFloat(input.Left) }),
305
- ...(input.Top != null && { Top: __serializeFloat(input.Top) }),
306
- ...(input.Width != null && { Width: __serializeFloat(input.Width) }),
307
- };
294
+ return take(input, {
295
+ Height: __serializeFloat,
296
+ Left: __serializeFloat,
297
+ Top: __serializeFloat,
298
+ Width: __serializeFloat,
299
+ });
308
300
  };
309
301
  const se_ClientChallenge = (input, context) => {
310
302
  return ClientChallenge.visit(input, {
@@ -315,133 +307,83 @@ const se_ClientChallenge = (input, context) => {
315
307
  });
316
308
  };
317
309
  const se_ClientSessionInformationEvent = (input, context) => {
318
- return {
319
- ...(input.Challenge != null && { Challenge: se_ClientChallenge(input.Challenge, context) }),
320
- };
321
- };
322
- const se_ColorComponentList = (input, context) => {
323
- return input
324
- .filter((e) => e != null)
325
- .map((entry) => {
326
- return entry;
310
+ return take(input, {
311
+ Challenge: (_) => se_ClientChallenge(_, context),
327
312
  });
328
313
  };
329
- const se_ColorDisplayed = (input, context) => {
330
- return {
331
- ...(input.CurrentColor != null && { CurrentColor: se_FreshnessColor(input.CurrentColor, context) }),
332
- ...(input.CurrentColorStartTimestamp != null && { CurrentColorStartTimestamp: input.CurrentColorStartTimestamp }),
333
- ...(input.PreviousColor != null && { PreviousColor: se_FreshnessColor(input.PreviousColor, context) }),
334
- ...(input.SequenceNumber != null && { SequenceNumber: input.SequenceNumber }),
335
- };
336
- };
337
314
  const se_FaceMovementAndLightClientChallenge = (input, context) => {
338
- return {
339
- ...(input.ChallengeId != null && { ChallengeId: input.ChallengeId }),
340
- ...(input.ColorDisplayed != null && { ColorDisplayed: se_ColorDisplayed(input.ColorDisplayed, context) }),
341
- ...(input.InitialFace != null && { InitialFace: se_InitialFace(input.InitialFace, context) }),
342
- ...(input.TargetFace != null && { TargetFace: se_TargetFace(input.TargetFace, context) }),
343
- ...(input.VideoEndTimestamp != null && { VideoEndTimestamp: input.VideoEndTimestamp }),
344
- ...(input.VideoStartTimestamp != null && { VideoStartTimestamp: input.VideoStartTimestamp }),
345
- };
346
- };
347
- const se_FreshnessColor = (input, context) => {
348
- return {
349
- ...(input.RGB != null && { RGB: se_ColorComponentList(input.RGB, context) }),
350
- };
315
+ return take(input, {
316
+ ChallengeId: [],
317
+ ColorDisplayed: _json,
318
+ InitialFace: (_) => se_InitialFace(_, context),
319
+ TargetFace: (_) => se_TargetFace(_, context),
320
+ VideoEndTimestamp: [],
321
+ VideoStartTimestamp: [],
322
+ });
351
323
  };
352
324
  const se_InitialFace = (input, context) => {
353
- return {
354
- ...(input.BoundingBox != null && { BoundingBox: se_BoundingBox(input.BoundingBox, context) }),
355
- ...(input.InitialFaceDetectedTimestamp != null && {
356
- InitialFaceDetectedTimestamp: input.InitialFaceDetectedTimestamp,
357
- }),
358
- };
325
+ return take(input, {
326
+ BoundingBox: (_) => se_BoundingBox(_, context),
327
+ InitialFaceDetectedTimestamp: [],
328
+ });
359
329
  };
360
330
  const se_TargetFace = (input, context) => {
361
- return {
362
- ...(input.BoundingBox != null && { BoundingBox: se_BoundingBox(input.BoundingBox, context) }),
363
- ...(input.FaceDetectedInTargetPositionEndTimestamp != null && {
364
- FaceDetectedInTargetPositionEndTimestamp: input.FaceDetectedInTargetPositionEndTimestamp,
365
- }),
366
- ...(input.FaceDetectedInTargetPositionStartTimestamp != null && {
367
- FaceDetectedInTargetPositionStartTimestamp: input.FaceDetectedInTargetPositionStartTimestamp,
368
- }),
369
- };
331
+ return take(input, {
332
+ BoundingBox: (_) => se_BoundingBox(_, context),
333
+ FaceDetectedInTargetPositionEndTimestamp: [],
334
+ FaceDetectedInTargetPositionStartTimestamp: [],
335
+ });
370
336
  };
371
337
  const se_VideoEvent = (input, context) => {
372
- return {
373
- ...(input.TimestampMillis != null && { TimestampMillis: input.TimestampMillis }),
374
- ...(input.VideoChunk != null && { VideoChunk: context.base64Encoder(input.VideoChunk) }),
375
- };
338
+ return take(input, {
339
+ TimestampMillis: [],
340
+ VideoChunk: context.base64Encoder,
341
+ });
376
342
  };
377
343
  const de_ChallengeConfig = (output, context) => {
378
- return {
379
- BlazeFaceDetectionThreshold: __limitedParseFloat32(output.BlazeFaceDetectionThreshold),
380
- FaceDistanceThreshold: __limitedParseFloat32(output.FaceDistanceThreshold),
381
- FaceDistanceThresholdMax: __limitedParseFloat32(output.FaceDistanceThresholdMax),
382
- FaceDistanceThresholdMin: __limitedParseFloat32(output.FaceDistanceThresholdMin),
383
- FaceIouHeightThreshold: __limitedParseFloat32(output.FaceIouHeightThreshold),
384
- FaceIouWidthThreshold: __limitedParseFloat32(output.FaceIouWidthThreshold),
385
- OvalHeightWidthRatio: __limitedParseFloat32(output.OvalHeightWidthRatio),
386
- OvalIouHeightThreshold: __limitedParseFloat32(output.OvalIouHeightThreshold),
387
- OvalIouThreshold: __limitedParseFloat32(output.OvalIouThreshold),
388
- OvalIouWidthThreshold: __limitedParseFloat32(output.OvalIouWidthThreshold),
389
- };
390
- };
391
- const de_ColorComponentList = (output, context) => {
392
- const retVal = (output || [])
393
- .filter((e) => e != null)
394
- .map((entry) => {
395
- if (entry === null) {
396
- return null;
397
- }
398
- return __expectInt32(entry);
344
+ return take(output, {
345
+ BlazeFaceDetectionThreshold: __limitedParseFloat32,
346
+ FaceDistanceThreshold: __limitedParseFloat32,
347
+ FaceDistanceThresholdMax: __limitedParseFloat32,
348
+ FaceDistanceThresholdMin: __limitedParseFloat32,
349
+ FaceIouHeightThreshold: __limitedParseFloat32,
350
+ FaceIouWidthThreshold: __limitedParseFloat32,
351
+ OvalHeightWidthRatio: __limitedParseFloat32,
352
+ OvalIouHeightThreshold: __limitedParseFloat32,
353
+ OvalIouThreshold: __limitedParseFloat32,
354
+ OvalIouWidthThreshold: __limitedParseFloat32,
399
355
  });
400
- return retVal;
401
356
  };
402
357
  const de_ColorSequence = (output, context) => {
403
- return {
404
- DownscrollDuration: __limitedParseFloat32(output.DownscrollDuration),
405
- FlatDisplayDuration: __limitedParseFloat32(output.FlatDisplayDuration),
406
- FreshnessColor: output.FreshnessColor != null ? de_FreshnessColor(output.FreshnessColor, context) : undefined,
407
- };
358
+ return take(output, {
359
+ DownscrollDuration: __limitedParseFloat32,
360
+ FlatDisplayDuration: __limitedParseFloat32,
361
+ FreshnessColor: _json,
362
+ });
408
363
  };
409
364
  const de_ColorSequences = (output, context) => {
410
365
  const retVal = (output || [])
411
366
  .filter((e) => e != null)
412
367
  .map((entry) => {
413
- if (entry === null) {
414
- return null;
415
- }
416
368
  return de_ColorSequence(entry, context);
417
369
  });
418
370
  return retVal;
419
371
  };
420
- const de_DisconnectionEvent = (output, context) => {
421
- return {
422
- TimestampMillis: __expectLong(output.TimestampMillis),
423
- };
424
- };
425
372
  const de_FaceMovementAndLightServerChallenge = (output, context) => {
426
- return {
427
- ChallengeConfig: output.ChallengeConfig != null ? de_ChallengeConfig(output.ChallengeConfig, context) : undefined,
428
- ColorSequences: output.ColorSequences != null ? de_ColorSequences(output.ColorSequences, context) : undefined,
429
- LightChallengeType: __expectString(output.LightChallengeType),
430
- OvalParameters: output.OvalParameters != null ? de_OvalParameters(output.OvalParameters, context) : undefined,
431
- };
432
- };
433
- const de_FreshnessColor = (output, context) => {
434
- return {
435
- RGB: output.RGB != null ? de_ColorComponentList(output.RGB, context) : undefined,
436
- };
373
+ return take(output, {
374
+ ChallengeConfig: (_) => de_ChallengeConfig(_, context),
375
+ ColorSequences: (_) => de_ColorSequences(_, context),
376
+ LightChallengeType: __expectString,
377
+ OvalParameters: (_) => de_OvalParameters(_, context),
378
+ });
437
379
  };
438
380
  const de_OvalParameters = (output, context) => {
439
- return {
440
- CenterX: __limitedParseFloat32(output.CenterX),
441
- CenterY: __limitedParseFloat32(output.CenterY),
442
- Height: __limitedParseFloat32(output.Height),
443
- Width: __limitedParseFloat32(output.Width),
444
- };
381
+ return take(output, {
382
+ CenterX: __limitedParseFloat32,
383
+ CenterY: __limitedParseFloat32,
384
+ Height: __limitedParseFloat32,
385
+ Width: __limitedParseFloat32,
386
+ });
445
387
  };
446
388
  const de_ServerChallenge = (output, context) => {
447
389
  if (output.FaceMovementAndLightChallenge != null) {
@@ -452,14 +394,14 @@ const de_ServerChallenge = (output, context) => {
452
394
  return { $unknown: Object.entries(output)[0] };
453
395
  };
454
396
  const de_ServerSessionInformationEvent = (output, context) => {
455
- return {
456
- SessionInformation: output.SessionInformation != null ? de_SessionInformation(output.SessionInformation, context) : undefined,
457
- };
397
+ return take(output, {
398
+ SessionInformation: (_) => de_SessionInformation(_, context),
399
+ });
458
400
  };
459
401
  const de_SessionInformation = (output, context) => {
460
- return {
461
- Challenge: output.Challenge != null ? de_ServerChallenge(__expectUnion(output.Challenge), context) : undefined,
462
- };
402
+ return take(output, {
403
+ Challenge: (_) => de_ServerChallenge(__expectUnion(_), context),
404
+ });
463
405
  };
464
406
  const deserializeMetadata = (output) => ({
465
407
  httpStatusCode: output.statusCode,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-rekognitionstreaming",
3
3
  "description": "AWS SDK for JavaScript Rekognitionstreaming Client for Node.js, Browser and React Native",
4
- "version": "3.312.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": "2.0.0",
23
23
  "@aws-crypto/sha256-js": "2.0.0",
24
- "@aws-sdk/client-sts": "3.312.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/eventstream-handler-node": "3.310.0",
28
28
  "@aws-sdk/eventstream-serde-browser": "3.310.0",
29
29
  "@aws-sdk/eventstream-serde-config-resolver": "3.310.0",
@@ -46,14 +46,14 @@
46
46
  "@aws-sdk/node-config-provider": "3.310.0",
47
47
  "@aws-sdk/node-http-handler": "3.310.0",
48
48
  "@aws-sdk/protocol-http": "3.310.0",
49
- "@aws-sdk/smithy-client": "3.310.0",
49
+ "@aws-sdk/smithy-client": "3.315.0",
50
50
  "@aws-sdk/types": "3.310.0",
51
51
  "@aws-sdk/url-parser": "3.310.0",
52
52
  "@aws-sdk/util-base64": "3.310.0",
53
53
  "@aws-sdk/util-body-length-browser": "3.310.0",
54
54
  "@aws-sdk/util-body-length-node": "3.310.0",
55
- "@aws-sdk/util-defaults-mode-browser": "3.310.0",
56
- "@aws-sdk/util-defaults-mode-node": "3.310.0",
55
+ "@aws-sdk/util-defaults-mode-browser": "3.315.0",
56
+ "@aws-sdk/util-defaults-mode-node": "3.315.0",
57
57
  "@aws-sdk/util-endpoints": "3.310.0",
58
58
  "@aws-sdk/util-retry": "3.310.0",
59
59
  "@aws-sdk/util-user-agent-browser": "3.310.0",