@aws-sdk/client-transcribe-streaming 3.131.0 → 3.140.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.
@@ -25,9 +25,7 @@ export var serializeAws_restJson1StartMedicalStreamTranscriptionCommand = functi
25
25
  }));
26
26
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/medical-stream-transcription";
27
27
  if (input.AudioStream !== undefined) {
28
- body = context.eventStreamMarshaller.serialize(input.AudioStream, function (event) {
29
- return serializeAws_restJson1AudioStream_event(event, context);
30
- });
28
+ body = serializeAws_restJson1AudioStream(input.AudioStream, context);
31
29
  }
32
30
  return [2, new __HttpRequest({
33
31
  protocol: protocol,
@@ -87,9 +85,7 @@ export var serializeAws_restJson1StartStreamTranscriptionCommand = function (inp
87
85
  }));
88
86
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/stream-transcription";
89
87
  if (input.AudioStream !== undefined) {
90
- body = context.eventStreamMarshaller.serialize(input.AudioStream, function (event) {
91
- return serializeAws_restJson1AudioStream_event(event, context);
92
- });
88
+ body = serializeAws_restJson1AudioStream(input.AudioStream, context);
93
89
  }
94
90
  return [2, new __HttpRequest({
95
91
  protocol: protocol,
@@ -161,30 +157,8 @@ export var deserializeAws_restJson1StartMedicalStreamTranscriptionCommand = func
161
157
  if (output.headers["x-amzn-transcribe-content-identification-type"] !== undefined) {
162
158
  contents.ContentIdentificationType = output.headers["x-amzn-transcribe-content-identification-type"];
163
159
  }
164
- data = context.eventStreamMarshaller.deserialize(output.body, function (event) { return __awaiter(void 0, void 0, void 0, function () {
165
- var eventName, eventHeaders, eventMessage, parsedEvent;
166
- var _a;
167
- return __generator(this, function (_b) {
168
- switch (_b.label) {
169
- case 0:
170
- eventName = Object.keys(event)[0];
171
- eventHeaders = Object.entries(event[eventName].headers).reduce(function (accummulator, curr) {
172
- accummulator[curr[0]] = curr[1].value;
173
- return accummulator;
174
- }, {});
175
- eventMessage = {
176
- headers: eventHeaders,
177
- body: event[eventName].body,
178
- };
179
- parsedEvent = (_a = {},
180
- _a[eventName] = eventMessage,
181
- _a);
182
- return [4, deserializeAws_restJson1MedicalTranscriptResultStream_event(parsedEvent, context)];
183
- case 1: return [2, _b.sent()];
184
- }
185
- });
186
- }); });
187
- contents.TranscriptResultStream = data;
160
+ data = output.body;
161
+ contents.TranscriptResultStream = deserializeAws_restJson1MedicalTranscriptResultStream(data, context);
188
162
  return [2, Promise.resolve(contents)];
189
163
  });
190
164
  }); };
@@ -335,30 +309,8 @@ export var deserializeAws_restJson1StartStreamTranscriptionCommand = function (o
335
309
  if (output.headers["x-amzn-transcribe-vocabulary-filter-names"] !== undefined) {
336
310
  contents.VocabularyFilterNames = output.headers["x-amzn-transcribe-vocabulary-filter-names"];
337
311
  }
338
- data = context.eventStreamMarshaller.deserialize(output.body, function (event) { return __awaiter(void 0, void 0, void 0, function () {
339
- var eventName, eventHeaders, eventMessage, parsedEvent;
340
- var _a;
341
- return __generator(this, function (_b) {
342
- switch (_b.label) {
343
- case 0:
344
- eventName = Object.keys(event)[0];
345
- eventHeaders = Object.entries(event[eventName].headers).reduce(function (accummulator, curr) {
346
- accummulator[curr[0]] = curr[1].value;
347
- return accummulator;
348
- }, {});
349
- eventMessage = {
350
- headers: eventHeaders,
351
- body: event[eventName].body,
352
- };
353
- parsedEvent = (_a = {},
354
- _a[eventName] = eventMessage,
355
- _a);
356
- return [4, deserializeAws_restJson1TranscriptResultStream_event(parsedEvent, context)];
357
- case 1: return [2, _b.sent()];
358
- }
359
- });
360
- }); });
361
- contents.TranscriptResultStream = data;
312
+ data = output.body;
313
+ contents.TranscriptResultStream = deserializeAws_restJson1TranscriptResultStream(data, context);
362
314
  return [2, Promise.resolve(contents)];
363
315
  });
364
316
  }); };
@@ -411,111 +363,178 @@ var deserializeAws_restJson1StartStreamTranscriptionCommandError = function (out
411
363
  }
412
364
  });
413
365
  }); };
414
- var serializeAws_restJson1AudioStream_event = function (input, context) {
415
- return AudioStream.visit(input, {
416
- AudioEvent: function (value) { return serializeAws_restJson1AudioEvent_event(value, context); },
417
- _: function (value) { return value; },
366
+ var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
367
+ var contents, data, exception;
368
+ return __generator(this, function (_a) {
369
+ contents = {};
370
+ data = parsedOutput.body;
371
+ if (data.Message !== undefined && data.Message !== null) {
372
+ contents.Message = __expectString(data.Message);
373
+ }
374
+ exception = new BadRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
375
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
418
376
  });
419
- };
420
- var deserializeAws_restJson1MedicalTranscriptResultStream_event = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
421
- var _a, _b, _c, _d, _e, _f;
422
- return __generator(this, function (_g) {
423
- switch (_g.label) {
424
- case 0:
425
- if (!(output["TranscriptEvent"] !== undefined)) return [3, 2];
426
- _a = {};
427
- return [4, deserializeAws_restJson1MedicalTranscriptEvent_event(output["TranscriptEvent"], context)];
428
- case 1: return [2, (_a.TranscriptEvent = _g.sent(),
429
- _a)];
430
- case 2:
431
- if (!(output["BadRequestException"] !== undefined)) return [3, 4];
432
- _b = {};
433
- return [4, deserializeAws_restJson1BadRequestException_event(output["BadRequestException"], context)];
434
- case 3: return [2, (_b.BadRequestException = _g.sent(),
435
- _b)];
436
- case 4:
437
- if (!(output["LimitExceededException"] !== undefined)) return [3, 6];
438
- _c = {};
439
- return [4, deserializeAws_restJson1LimitExceededException_event(output["LimitExceededException"], context)];
440
- case 5: return [2, (_c.LimitExceededException = _g.sent(),
441
- _c)];
442
- case 6:
443
- if (!(output["InternalFailureException"] !== undefined)) return [3, 8];
444
- _d = {};
445
- return [4, deserializeAws_restJson1InternalFailureException_event(output["InternalFailureException"], context)];
446
- case 7: return [2, (_d.InternalFailureException = _g.sent(),
447
- _d)];
448
- case 8:
449
- if (!(output["ConflictException"] !== undefined)) return [3, 10];
450
- _e = {};
451
- return [4, deserializeAws_restJson1ConflictException_event(output["ConflictException"], context)];
452
- case 9: return [2, (_e.ConflictException = _g.sent(),
453
- _e)];
454
- case 10:
455
- if (!(output["ServiceUnavailableException"] !== undefined)) return [3, 12];
456
- _f = {};
457
- return [4, deserializeAws_restJson1ServiceUnavailableException_event(output["ServiceUnavailableException"], context)];
458
- case 11: return [2, (_f.ServiceUnavailableException = _g.sent(),
459
- _f)];
460
- case 12: return [2, { $unknown: output }];
377
+ }); };
378
+ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
379
+ var contents, data, exception;
380
+ return __generator(this, function (_a) {
381
+ contents = {};
382
+ data = parsedOutput.body;
383
+ if (data.Message !== undefined && data.Message !== null) {
384
+ contents.Message = __expectString(data.Message);
461
385
  }
386
+ exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
387
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
462
388
  });
463
389
  }); };
464
- var deserializeAws_restJson1TranscriptResultStream_event = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
465
- var _a, _b, _c, _d, _e, _f;
466
- return __generator(this, function (_g) {
467
- switch (_g.label) {
468
- case 0:
469
- if (!(output["TranscriptEvent"] !== undefined)) return [3, 2];
470
- _a = {};
471
- return [4, deserializeAws_restJson1TranscriptEvent_event(output["TranscriptEvent"], context)];
472
- case 1: return [2, (_a.TranscriptEvent = _g.sent(),
473
- _a)];
474
- case 2:
475
- if (!(output["BadRequestException"] !== undefined)) return [3, 4];
476
- _b = {};
477
- return [4, deserializeAws_restJson1BadRequestException_event(output["BadRequestException"], context)];
478
- case 3: return [2, (_b.BadRequestException = _g.sent(),
479
- _b)];
480
- case 4:
481
- if (!(output["LimitExceededException"] !== undefined)) return [3, 6];
482
- _c = {};
483
- return [4, deserializeAws_restJson1LimitExceededException_event(output["LimitExceededException"], context)];
484
- case 5: return [2, (_c.LimitExceededException = _g.sent(),
485
- _c)];
486
- case 6:
487
- if (!(output["InternalFailureException"] !== undefined)) return [3, 8];
488
- _d = {};
489
- return [4, deserializeAws_restJson1InternalFailureException_event(output["InternalFailureException"], context)];
490
- case 7: return [2, (_d.InternalFailureException = _g.sent(),
491
- _d)];
492
- case 8:
493
- if (!(output["ConflictException"] !== undefined)) return [3, 10];
494
- _e = {};
495
- return [4, deserializeAws_restJson1ConflictException_event(output["ConflictException"], context)];
496
- case 9: return [2, (_e.ConflictException = _g.sent(),
497
- _e)];
498
- case 10:
499
- if (!(output["ServiceUnavailableException"] !== undefined)) return [3, 12];
500
- _f = {};
501
- return [4, deserializeAws_restJson1ServiceUnavailableException_event(output["ServiceUnavailableException"], context)];
502
- case 11: return [2, (_f.ServiceUnavailableException = _g.sent(),
503
- _f)];
504
- case 12: return [2, { $unknown: output }];
390
+ var deserializeAws_restJson1InternalFailureExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
391
+ var contents, data, exception;
392
+ return __generator(this, function (_a) {
393
+ contents = {};
394
+ data = parsedOutput.body;
395
+ if (data.Message !== undefined && data.Message !== null) {
396
+ contents.Message = __expectString(data.Message);
505
397
  }
398
+ exception = new InternalFailureException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
399
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
506
400
  });
507
401
  }); };
402
+ var deserializeAws_restJson1LimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
403
+ var contents, data, exception;
404
+ return __generator(this, function (_a) {
405
+ contents = {};
406
+ data = parsedOutput.body;
407
+ if (data.Message !== undefined && data.Message !== null) {
408
+ contents.Message = __expectString(data.Message);
409
+ }
410
+ exception = new LimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
411
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
412
+ });
413
+ }); };
414
+ var deserializeAws_restJson1ServiceUnavailableExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
415
+ var contents, data, exception;
416
+ return __generator(this, function (_a) {
417
+ contents = {};
418
+ data = parsedOutput.body;
419
+ if (data.Message !== undefined && data.Message !== null) {
420
+ contents.Message = __expectString(data.Message);
421
+ }
422
+ exception = new ServiceUnavailableException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
423
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
424
+ });
425
+ }); };
426
+ var serializeAws_restJson1AudioStream = function (input, context) {
427
+ var eventMarshallingVisitor = function (event) {
428
+ return AudioStream.visit(event, {
429
+ AudioEvent: function (value) { return serializeAws_restJson1AudioEvent_event(value, context); },
430
+ _: function (value) { return value; },
431
+ });
432
+ };
433
+ return context.eventStreamMarshaller.serialize(input, eventMarshallingVisitor);
434
+ };
508
435
  var serializeAws_restJson1AudioEvent_event = function (input, context) {
509
- var message = {
510
- headers: {
511
- ":event-type": { type: "string", value: "AudioEvent" },
512
- ":message-type": { type: "string", value: "event" },
513
- ":content-type": { type: "string", value: "application/octet-stream" },
514
- },
515
- body: new Uint8Array(),
436
+ var headers = {
437
+ ":event-type": { type: "string", value: "AudioEvent" },
438
+ ":message-type": { type: "string", value: "event" },
439
+ ":content-type": { type: "string", value: "application/octet-stream" },
516
440
  };
517
- message.body = input.AudioChunk || message.body;
518
- return message;
441
+ var body = new Uint8Array();
442
+ if (input.AudioChunk != null) {
443
+ body = input.AudioChunk;
444
+ }
445
+ return { headers: headers, body: body };
446
+ };
447
+ var deserializeAws_restJson1MedicalTranscriptResultStream = function (output, context) {
448
+ return context.eventStreamMarshaller.deserialize(output, function (event) { return __awaiter(void 0, void 0, void 0, function () {
449
+ var _a, _b, _c, _d, _e, _f;
450
+ return __generator(this, function (_g) {
451
+ switch (_g.label) {
452
+ case 0:
453
+ if (!(event["TranscriptEvent"] != null)) return [3, 2];
454
+ _a = {};
455
+ return [4, deserializeAws_restJson1MedicalTranscriptEvent_event(event["TranscriptEvent"], context)];
456
+ case 1: return [2, (_a.TranscriptEvent = _g.sent(),
457
+ _a)];
458
+ case 2:
459
+ if (!(event["BadRequestException"] != null)) return [3, 4];
460
+ _b = {};
461
+ return [4, deserializeAws_restJson1BadRequestException_event(event["BadRequestException"], context)];
462
+ case 3: return [2, (_b.BadRequestException = _g.sent(),
463
+ _b)];
464
+ case 4:
465
+ if (!(event["LimitExceededException"] != null)) return [3, 6];
466
+ _c = {};
467
+ return [4, deserializeAws_restJson1LimitExceededException_event(event["LimitExceededException"], context)];
468
+ case 5: return [2, (_c.LimitExceededException = _g.sent(),
469
+ _c)];
470
+ case 6:
471
+ if (!(event["InternalFailureException"] != null)) return [3, 8];
472
+ _d = {};
473
+ return [4, deserializeAws_restJson1InternalFailureException_event(event["InternalFailureException"], context)];
474
+ case 7: return [2, (_d.InternalFailureException = _g.sent(),
475
+ _d)];
476
+ case 8:
477
+ if (!(event["ConflictException"] != null)) return [3, 10];
478
+ _e = {};
479
+ return [4, deserializeAws_restJson1ConflictException_event(event["ConflictException"], context)];
480
+ case 9: return [2, (_e.ConflictException = _g.sent(),
481
+ _e)];
482
+ case 10:
483
+ if (!(event["ServiceUnavailableException"] != null)) return [3, 12];
484
+ _f = {};
485
+ return [4, deserializeAws_restJson1ServiceUnavailableException_event(event["ServiceUnavailableException"], context)];
486
+ case 11: return [2, (_f.ServiceUnavailableException = _g.sent(),
487
+ _f)];
488
+ case 12: return [2, { $unknown: output }];
489
+ }
490
+ });
491
+ }); });
492
+ };
493
+ var deserializeAws_restJson1TranscriptResultStream = function (output, context) {
494
+ return context.eventStreamMarshaller.deserialize(output, function (event) { return __awaiter(void 0, void 0, void 0, function () {
495
+ var _a, _b, _c, _d, _e, _f;
496
+ return __generator(this, function (_g) {
497
+ switch (_g.label) {
498
+ case 0:
499
+ if (!(event["TranscriptEvent"] != null)) return [3, 2];
500
+ _a = {};
501
+ return [4, deserializeAws_restJson1TranscriptEvent_event(event["TranscriptEvent"], context)];
502
+ case 1: return [2, (_a.TranscriptEvent = _g.sent(),
503
+ _a)];
504
+ case 2:
505
+ if (!(event["BadRequestException"] != null)) return [3, 4];
506
+ _b = {};
507
+ return [4, deserializeAws_restJson1BadRequestException_event(event["BadRequestException"], context)];
508
+ case 3: return [2, (_b.BadRequestException = _g.sent(),
509
+ _b)];
510
+ case 4:
511
+ if (!(event["LimitExceededException"] != null)) return [3, 6];
512
+ _c = {};
513
+ return [4, deserializeAws_restJson1LimitExceededException_event(event["LimitExceededException"], context)];
514
+ case 5: return [2, (_c.LimitExceededException = _g.sent(),
515
+ _c)];
516
+ case 6:
517
+ if (!(event["InternalFailureException"] != null)) return [3, 8];
518
+ _d = {};
519
+ return [4, deserializeAws_restJson1InternalFailureException_event(event["InternalFailureException"], context)];
520
+ case 7: return [2, (_d.InternalFailureException = _g.sent(),
521
+ _d)];
522
+ case 8:
523
+ if (!(event["ConflictException"] != null)) return [3, 10];
524
+ _e = {};
525
+ return [4, deserializeAws_restJson1ConflictException_event(event["ConflictException"], context)];
526
+ case 9: return [2, (_e.ConflictException = _g.sent(),
527
+ _e)];
528
+ case 10:
529
+ if (!(event["ServiceUnavailableException"] != null)) return [3, 12];
530
+ _f = {};
531
+ return [4, deserializeAws_restJson1ServiceUnavailableException_event(event["ServiceUnavailableException"], context)];
532
+ case 11: return [2, (_f.ServiceUnavailableException = _g.sent(),
533
+ _f)];
534
+ case 12: return [2, { $unknown: output }];
535
+ }
536
+ });
537
+ }); });
519
538
  };
520
539
  var deserializeAws_restJson1BadRequestException_event = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
521
540
  var parsedOutput, _a;
@@ -586,7 +605,7 @@ var deserializeAws_restJson1MedicalTranscriptEvent_event = function (output, con
586
605
  return [4, parseBody(output.body, context)];
587
606
  case 1:
588
607
  data = _a.sent();
589
- contents = __assign(__assign({}, contents), deserializeAws_restJson1MedicalTranscriptEvent(data, context));
608
+ Object.assign(contents, deserializeAws_restJson1MedicalTranscriptEvent(data, context));
590
609
  return [2, contents];
591
610
  }
592
611
  });
@@ -615,80 +634,11 @@ var deserializeAws_restJson1TranscriptEvent_event = function (output, context) {
615
634
  return [4, parseBody(output.body, context)];
616
635
  case 1:
617
636
  data = _a.sent();
618
- contents = __assign(__assign({}, contents), deserializeAws_restJson1TranscriptEvent(data, context));
637
+ Object.assign(contents, deserializeAws_restJson1TranscriptEvent(data, context));
619
638
  return [2, contents];
620
639
  }
621
640
  });
622
641
  }); };
623
- var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
624
- var contents, data, exception;
625
- return __generator(this, function (_a) {
626
- contents = {};
627
- data = parsedOutput.body;
628
- if (data.Message !== undefined && data.Message !== null) {
629
- contents.Message = __expectString(data.Message);
630
- }
631
- exception = new BadRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
632
- return [2, __decorateServiceException(exception, parsedOutput.body)];
633
- });
634
- }); };
635
- var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
636
- var contents, data, exception;
637
- return __generator(this, function (_a) {
638
- contents = {};
639
- data = parsedOutput.body;
640
- if (data.Message !== undefined && data.Message !== null) {
641
- contents.Message = __expectString(data.Message);
642
- }
643
- exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
644
- return [2, __decorateServiceException(exception, parsedOutput.body)];
645
- });
646
- }); };
647
- var deserializeAws_restJson1InternalFailureExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
648
- var contents, data, exception;
649
- return __generator(this, function (_a) {
650
- contents = {};
651
- data = parsedOutput.body;
652
- if (data.Message !== undefined && data.Message !== null) {
653
- contents.Message = __expectString(data.Message);
654
- }
655
- exception = new InternalFailureException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
656
- return [2, __decorateServiceException(exception, parsedOutput.body)];
657
- });
658
- }); };
659
- var deserializeAws_restJson1LimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
660
- var contents, data, exception;
661
- return __generator(this, function (_a) {
662
- contents = {};
663
- data = parsedOutput.body;
664
- if (data.Message !== undefined && data.Message !== null) {
665
- contents.Message = __expectString(data.Message);
666
- }
667
- exception = new LimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
668
- return [2, __decorateServiceException(exception, parsedOutput.body)];
669
- });
670
- }); };
671
- var deserializeAws_restJson1ServiceUnavailableExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
672
- var contents, data, exception;
673
- return __generator(this, function (_a) {
674
- contents = {};
675
- data = parsedOutput.body;
676
- if (data.Message !== undefined && data.Message !== null) {
677
- contents.Message = __expectString(data.Message);
678
- }
679
- exception = new ServiceUnavailableException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
680
- return [2, __decorateServiceException(exception, parsedOutput.body)];
681
- });
682
- }); };
683
- var serializeAws_restJson1AudioEvent = function (input, context) {
684
- return __assign({}, (input.AudioChunk != null && { AudioChunk: context.base64Encoder(input.AudioChunk) }));
685
- };
686
- var serializeAws_restJson1AudioStream = function (input, context) {
687
- return AudioStream.visit(input, {
688
- AudioEvent: function (value) { return ({ AudioEvent: serializeAws_restJson1AudioEvent(value, context) }); },
689
- _: function (name, value) { return ({ name: value }); },
690
- });
691
- };
692
642
  var deserializeAws_restJson1Alternative = function (output, context) {
693
643
  return {
694
644
  Entities: output.Entities != null ? deserializeAws_restJson1EntityList(output.Entities, context) : undefined,
@@ -707,16 +657,6 @@ var deserializeAws_restJson1AlternativeList = function (output, context) {
707
657
  });
708
658
  return retVal;
709
659
  };
710
- var deserializeAws_restJson1BadRequestException = function (output, context) {
711
- return {
712
- Message: __expectString(output.Message),
713
- };
714
- };
715
- var deserializeAws_restJson1ConflictException = function (output, context) {
716
- return {
717
- Message: __expectString(output.Message),
718
- };
719
- };
720
660
  var deserializeAws_restJson1Entity = function (output, context) {
721
661
  return {
722
662
  Category: __expectString(output.Category),
@@ -738,11 +678,6 @@ var deserializeAws_restJson1EntityList = function (output, context) {
738
678
  });
739
679
  return retVal;
740
680
  };
741
- var deserializeAws_restJson1InternalFailureException = function (output, context) {
742
- return {
743
- Message: __expectString(output.Message),
744
- };
745
- };
746
681
  var deserializeAws_restJson1Item = function (output, context) {
747
682
  return {
748
683
  Confidence: __limitedParseDouble(output.Confidence),
@@ -783,11 +718,6 @@ var deserializeAws_restJson1LanguageWithScore = function (output, context) {
783
718
  Score: __limitedParseDouble(output.Score),
784
719
  };
785
720
  };
786
- var deserializeAws_restJson1LimitExceededException = function (output, context) {
787
- return {
788
- Message: __expectString(output.Message),
789
- };
790
- };
791
721
  var deserializeAws_restJson1MedicalAlternative = function (output, context) {
792
722
  return {
793
723
  Entities: output.Entities != null ? deserializeAws_restJson1MedicalEntityList(output.Entities, context) : undefined,
@@ -880,39 +810,6 @@ var deserializeAws_restJson1MedicalTranscriptEvent = function (output, context)
880
810
  Transcript: output.Transcript != null ? deserializeAws_restJson1MedicalTranscript(output.Transcript, context) : undefined,
881
811
  };
882
812
  };
883
- var deserializeAws_restJson1MedicalTranscriptResultStream = function (output, context) {
884
- if (output.BadRequestException !== undefined && output.BadRequestException !== null) {
885
- return {
886
- BadRequestException: deserializeAws_restJson1BadRequestException(output.BadRequestException, context),
887
- };
888
- }
889
- if (output.ConflictException !== undefined && output.ConflictException !== null) {
890
- return {
891
- ConflictException: deserializeAws_restJson1ConflictException(output.ConflictException, context),
892
- };
893
- }
894
- if (output.InternalFailureException !== undefined && output.InternalFailureException !== null) {
895
- return {
896
- InternalFailureException: deserializeAws_restJson1InternalFailureException(output.InternalFailureException, context),
897
- };
898
- }
899
- if (output.LimitExceededException !== undefined && output.LimitExceededException !== null) {
900
- return {
901
- LimitExceededException: deserializeAws_restJson1LimitExceededException(output.LimitExceededException, context),
902
- };
903
- }
904
- if (output.ServiceUnavailableException !== undefined && output.ServiceUnavailableException !== null) {
905
- return {
906
- ServiceUnavailableException: deserializeAws_restJson1ServiceUnavailableException(output.ServiceUnavailableException, context),
907
- };
908
- }
909
- if (output.TranscriptEvent !== undefined && output.TranscriptEvent !== null) {
910
- return {
911
- TranscriptEvent: deserializeAws_restJson1MedicalTranscriptEvent(output.TranscriptEvent, context),
912
- };
913
- }
914
- return { $unknown: Object.entries(output)[0] };
915
- };
916
813
  var deserializeAws_restJson1Result = function (output, context) {
917
814
  return {
918
815
  Alternatives: output.Alternatives != null ? deserializeAws_restJson1AlternativeList(output.Alternatives, context) : undefined,
@@ -938,11 +835,6 @@ var deserializeAws_restJson1ResultList = function (output, context) {
938
835
  });
939
836
  return retVal;
940
837
  };
941
- var deserializeAws_restJson1ServiceUnavailableException = function (output, context) {
942
- return {
943
- Message: __expectString(output.Message),
944
- };
945
- };
946
838
  var deserializeAws_restJson1Transcript = function (output, context) {
947
839
  return {
948
840
  Results: output.Results != null ? deserializeAws_restJson1ResultList(output.Results, context) : undefined,
@@ -953,39 +845,6 @@ var deserializeAws_restJson1TranscriptEvent = function (output, context) {
953
845
  Transcript: output.Transcript != null ? deserializeAws_restJson1Transcript(output.Transcript, context) : undefined,
954
846
  };
955
847
  };
956
- var deserializeAws_restJson1TranscriptResultStream = function (output, context) {
957
- if (output.BadRequestException !== undefined && output.BadRequestException !== null) {
958
- return {
959
- BadRequestException: deserializeAws_restJson1BadRequestException(output.BadRequestException, context),
960
- };
961
- }
962
- if (output.ConflictException !== undefined && output.ConflictException !== null) {
963
- return {
964
- ConflictException: deserializeAws_restJson1ConflictException(output.ConflictException, context),
965
- };
966
- }
967
- if (output.InternalFailureException !== undefined && output.InternalFailureException !== null) {
968
- return {
969
- InternalFailureException: deserializeAws_restJson1InternalFailureException(output.InternalFailureException, context),
970
- };
971
- }
972
- if (output.LimitExceededException !== undefined && output.LimitExceededException !== null) {
973
- return {
974
- LimitExceededException: deserializeAws_restJson1LimitExceededException(output.LimitExceededException, context),
975
- };
976
- }
977
- if (output.ServiceUnavailableException !== undefined && output.ServiceUnavailableException !== null) {
978
- return {
979
- ServiceUnavailableException: deserializeAws_restJson1ServiceUnavailableException(output.ServiceUnavailableException, context),
980
- };
981
- }
982
- if (output.TranscriptEvent !== undefined && output.TranscriptEvent !== null) {
983
- return {
984
- TranscriptEvent: deserializeAws_restJson1TranscriptEvent(output.TranscriptEvent, context),
985
- };
986
- }
987
- return { $unknown: Object.entries(output)[0] };
988
- };
989
848
  var deserializeMetadata = function (output) {
990
849
  var _a;
991
850
  return ({
@@ -8,7 +8,7 @@ import { eventStreamSerdeProvider } from "@aws-sdk/eventstream-serde-node";
8
8
  import { Hash } from "@aws-sdk/hash-node";
9
9
  import { DEFAULT_RETRY_MODE, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS, } from "@aws-sdk/middleware-retry";
10
10
  import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider";
11
- import { NodeHttp2Handler, streamCollector } from "@aws-sdk/node-http-handler";
11
+ import { NodeHttp2Handler as RequestHandler, streamCollector } from "@aws-sdk/node-http-handler";
12
12
  import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node";
13
13
  import { calculateBodyLength } from "@aws-sdk/util-body-length-node";
14
14
  import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
@@ -23,7 +23,14 @@ export var getRuntimeConfig = function (config) {
23
23
  var defaultsMode = resolveDefaultsModeConfig(config);
24
24
  var defaultConfigProvider = function () { return defaultsMode().then(loadConfigsForDefaultMode); };
25
25
  var clientSharedValues = getSharedRuntimeConfig(config);
26
- return __assign(__assign(__assign({}, clientSharedValues), config), { runtime: "node", defaultsMode: defaultsMode, base64Decoder: (_a = config === null || config === void 0 ? void 0 : config.base64Decoder) !== null && _a !== void 0 ? _a : fromBase64, base64Encoder: (_b = config === null || config === void 0 ? void 0 : config.base64Encoder) !== null && _b !== void 0 ? _b : toBase64, bodyLengthChecker: (_c = config === null || config === void 0 ? void 0 : config.bodyLengthChecker) !== null && _c !== void 0 ? _c : calculateBodyLength, credentialDefaultProvider: (_d = config === null || config === void 0 ? void 0 : config.credentialDefaultProvider) !== null && _d !== void 0 ? _d : decorateDefaultCredentialProvider(credentialDefaultProvider), defaultUserAgentProvider: (_e = config === null || config === void 0 ? void 0 : config.defaultUserAgentProvider) !== null && _e !== void 0 ? _e : defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), eventStreamPayloadHandlerProvider: (_f = config === null || config === void 0 ? void 0 : config.eventStreamPayloadHandlerProvider) !== null && _f !== void 0 ? _f : eventStreamPayloadHandlerProvider, eventStreamSerdeProvider: (_g = config === null || config === void 0 ? void 0 : config.eventStreamSerdeProvider) !== null && _g !== void 0 ? _g : eventStreamSerdeProvider, maxAttempts: (_h = config === null || config === void 0 ? void 0 : config.maxAttempts) !== null && _h !== void 0 ? _h : loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: (_j = config === null || config === void 0 ? void 0 : config.region) !== null && _j !== void 0 ? _j : loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: (_k = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _k !== void 0 ? _k : new NodeHttp2Handler({ disableConcurrentStreams: true }), retryMode: (_l = config === null || config === void 0 ? void 0 : config.retryMode) !== null && _l !== void 0 ? _l : loadNodeConfig(__assign(__assign({}, NODE_RETRY_MODE_CONFIG_OPTIONS), { default: function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
26
+ return __assign(__assign(__assign({}, clientSharedValues), config), { runtime: "node", defaultsMode: defaultsMode, base64Decoder: (_a = config === null || config === void 0 ? void 0 : config.base64Decoder) !== null && _a !== void 0 ? _a : fromBase64, base64Encoder: (_b = config === null || config === void 0 ? void 0 : config.base64Encoder) !== null && _b !== void 0 ? _b : toBase64, bodyLengthChecker: (_c = config === null || config === void 0 ? void 0 : config.bodyLengthChecker) !== null && _c !== void 0 ? _c : calculateBodyLength, credentialDefaultProvider: (_d = config === null || config === void 0 ? void 0 : config.credentialDefaultProvider) !== null && _d !== void 0 ? _d : decorateDefaultCredentialProvider(credentialDefaultProvider), defaultUserAgentProvider: (_e = config === null || config === void 0 ? void 0 : config.defaultUserAgentProvider) !== null && _e !== void 0 ? _e : defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), eventStreamPayloadHandlerProvider: (_f = config === null || config === void 0 ? void 0 : config.eventStreamPayloadHandlerProvider) !== null && _f !== void 0 ? _f : eventStreamPayloadHandlerProvider, eventStreamSerdeProvider: (_g = config === null || config === void 0 ? void 0 : config.eventStreamSerdeProvider) !== null && _g !== void 0 ? _g : eventStreamSerdeProvider, maxAttempts: (_h = config === null || config === void 0 ? void 0 : config.maxAttempts) !== null && _h !== void 0 ? _h : loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: (_j = config === null || config === void 0 ? void 0 : config.region) !== null && _j !== void 0 ? _j : loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: (_k = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _k !== void 0 ? _k : new RequestHandler(function () { return __awaiter(void 0, void 0, void 0, function () { var _a; return __generator(this, function (_b) {
27
+ switch (_b.label) {
28
+ case 0:
29
+ _a = [{}];
30
+ return [4, defaultConfigProvider()];
31
+ case 1: return [2, (__assign.apply(void 0, [__assign.apply(void 0, _a.concat([(_b.sent())])), { disableConcurrentStreams: true }]))];
32
+ }
33
+ }); }); }), retryMode: (_l = config === null || config === void 0 ? void 0 : config.retryMode) !== null && _l !== void 0 ? _l : loadNodeConfig(__assign(__assign({}, NODE_RETRY_MODE_CONFIG_OPTIONS), { default: function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
27
34
  switch (_a.label) {
28
35
  case 0: return [4, defaultConfigProvider()];
29
36
  case 1: return [2, (_a.sent()).retryMode || DEFAULT_RETRY_MODE];