@aws-sdk/client-lex-runtime-v2 3.131.0 → 3.135.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.
@@ -385,9 +385,7 @@ export var serializeAws_restJson1StartConversationCommand = function (input, con
385
385
  throw new Error("No value provided for input HTTP label: sessionId.");
386
386
  }
387
387
  if (input.requestEventStream !== undefined) {
388
- body = context.eventStreamMarshaller.serialize(input.requestEventStream, function (event) {
389
- return serializeAws_restJson1StartConversationRequestEventStream_event(event, context);
390
- });
388
+ body = serializeAws_restJson1StartConversationRequestEventStream(input.requestEventStream, context);
391
389
  }
392
390
  return [2, new __HttpRequest({
393
391
  protocol: protocol,
@@ -890,30 +888,8 @@ export var deserializeAws_restJson1StartConversationCommand = function (output,
890
888
  $metadata: deserializeMetadata(output),
891
889
  responseEventStream: undefined,
892
890
  };
893
- data = context.eventStreamMarshaller.deserialize(output.body, function (event) { return __awaiter(void 0, void 0, void 0, function () {
894
- var eventName, eventHeaders, eventMessage, parsedEvent;
895
- var _a;
896
- return __generator(this, function (_b) {
897
- switch (_b.label) {
898
- case 0:
899
- eventName = Object.keys(event)[0];
900
- eventHeaders = Object.entries(event[eventName].headers).reduce(function (accummulator, curr) {
901
- accummulator[curr[0]] = curr[1].value;
902
- return accummulator;
903
- }, {});
904
- eventMessage = {
905
- headers: eventHeaders,
906
- body: event[eventName].body,
907
- };
908
- parsedEvent = (_a = {},
909
- _a[eventName] = eventMessage,
910
- _a);
911
- return [4, deserializeAws_restJson1StartConversationResponseEventStream_event(parsedEvent, context)];
912
- case 1: return [2, _b.sent()];
913
- }
914
- });
915
- }); });
916
- contents.responseEventStream = data;
891
+ data = output.body;
892
+ contents.responseEventStream = deserializeAws_restJson1StartConversationResponseEventStream(data, context);
917
893
  return [2, Promise.resolve(contents)];
918
894
  });
919
895
  }); };
@@ -962,186 +938,275 @@ var deserializeAws_restJson1StartConversationCommandError = function (output, co
962
938
  }
963
939
  });
964
940
  }); };
965
- var serializeAws_restJson1StartConversationRequestEventStream_event = function (input, context) {
966
- return StartConversationRequestEventStream.visit(input, {
967
- ConfigurationEvent: function (value) { return serializeAws_restJson1ConfigurationEvent_event(value, context); },
968
- AudioInputEvent: function (value) { return serializeAws_restJson1AudioInputEvent_event(value, context); },
969
- DTMFInputEvent: function (value) { return serializeAws_restJson1DTMFInputEvent_event(value, context); },
970
- TextInputEvent: function (value) { return serializeAws_restJson1TextInputEvent_event(value, context); },
971
- PlaybackCompletionEvent: function (value) { return serializeAws_restJson1PlaybackCompletionEvent_event(value, context); },
972
- DisconnectionEvent: function (value) { return serializeAws_restJson1DisconnectionEvent_event(value, context); },
973
- _: function (value) { return value; },
941
+ var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
942
+ var contents, data, exception;
943
+ return __generator(this, function (_a) {
944
+ contents = {};
945
+ data = parsedOutput.body;
946
+ if (data.message !== undefined && data.message !== null) {
947
+ contents.message = __expectString(data.message);
948
+ }
949
+ exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
950
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
974
951
  });
975
- };
976
- var deserializeAws_restJson1StartConversationResponseEventStream_event = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
977
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
978
- return __generator(this, function (_q) {
979
- switch (_q.label) {
980
- case 0:
981
- if (!(output["PlaybackInterruptionEvent"] !== undefined)) return [3, 2];
982
- _a = {};
983
- return [4, deserializeAws_restJson1PlaybackInterruptionEvent_event(output["PlaybackInterruptionEvent"], context)];
984
- case 1: return [2, (_a.PlaybackInterruptionEvent = _q.sent(),
985
- _a)];
986
- case 2:
987
- if (!(output["TranscriptEvent"] !== undefined)) return [3, 4];
988
- _b = {};
989
- return [4, deserializeAws_restJson1TranscriptEvent_event(output["TranscriptEvent"], context)];
990
- case 3: return [2, (_b.TranscriptEvent = _q.sent(),
991
- _b)];
992
- case 4:
993
- if (!(output["IntentResultEvent"] !== undefined)) return [3, 6];
994
- _c = {};
995
- return [4, deserializeAws_restJson1IntentResultEvent_event(output["IntentResultEvent"], context)];
996
- case 5: return [2, (_c.IntentResultEvent = _q.sent(),
997
- _c)];
998
- case 6:
999
- if (!(output["TextResponseEvent"] !== undefined)) return [3, 8];
1000
- _d = {};
1001
- return [4, deserializeAws_restJson1TextResponseEvent_event(output["TextResponseEvent"], context)];
1002
- case 7: return [2, (_d.TextResponseEvent = _q.sent(),
1003
- _d)];
1004
- case 8:
1005
- if (!(output["AudioResponseEvent"] !== undefined)) return [3, 10];
1006
- _e = {};
1007
- return [4, deserializeAws_restJson1AudioResponseEvent_event(output["AudioResponseEvent"], context)];
1008
- case 9: return [2, (_e.AudioResponseEvent = _q.sent(),
1009
- _e)];
1010
- case 10:
1011
- if (!(output["HeartbeatEvent"] !== undefined)) return [3, 12];
1012
- _f = {};
1013
- return [4, deserializeAws_restJson1HeartbeatEvent_event(output["HeartbeatEvent"], context)];
1014
- case 11: return [2, (_f.HeartbeatEvent = _q.sent(),
1015
- _f)];
1016
- case 12:
1017
- if (!(output["AccessDeniedException"] !== undefined)) return [3, 14];
1018
- _g = {};
1019
- return [4, deserializeAws_restJson1AccessDeniedException_event(output["AccessDeniedException"], context)];
1020
- case 13: return [2, (_g.AccessDeniedException = _q.sent(),
1021
- _g)];
1022
- case 14:
1023
- if (!(output["ResourceNotFoundException"] !== undefined)) return [3, 16];
1024
- _h = {};
1025
- return [4, deserializeAws_restJson1ResourceNotFoundException_event(output["ResourceNotFoundException"], context)];
1026
- case 15: return [2, (_h.ResourceNotFoundException = _q.sent(),
1027
- _h)];
1028
- case 16:
1029
- if (!(output["ValidationException"] !== undefined)) return [3, 18];
1030
- _j = {};
1031
- return [4, deserializeAws_restJson1ValidationException_event(output["ValidationException"], context)];
1032
- case 17: return [2, (_j.ValidationException = _q.sent(),
1033
- _j)];
1034
- case 18:
1035
- if (!(output["ThrottlingException"] !== undefined)) return [3, 20];
1036
- _k = {};
1037
- return [4, deserializeAws_restJson1ThrottlingException_event(output["ThrottlingException"], context)];
1038
- case 19: return [2, (_k.ThrottlingException = _q.sent(),
1039
- _k)];
1040
- case 20:
1041
- if (!(output["InternalServerException"] !== undefined)) return [3, 22];
1042
- _l = {};
1043
- return [4, deserializeAws_restJson1InternalServerException_event(output["InternalServerException"], context)];
1044
- case 21: return [2, (_l.InternalServerException = _q.sent(),
1045
- _l)];
1046
- case 22:
1047
- if (!(output["ConflictException"] !== undefined)) return [3, 24];
1048
- _m = {};
1049
- return [4, deserializeAws_restJson1ConflictException_event(output["ConflictException"], context)];
1050
- case 23: return [2, (_m.ConflictException = _q.sent(),
1051
- _m)];
1052
- case 24:
1053
- if (!(output["DependencyFailedException"] !== undefined)) return [3, 26];
1054
- _o = {};
1055
- return [4, deserializeAws_restJson1DependencyFailedException_event(output["DependencyFailedException"], context)];
1056
- case 25: return [2, (_o.DependencyFailedException = _q.sent(),
1057
- _o)];
1058
- case 26:
1059
- if (!(output["BadGatewayException"] !== undefined)) return [3, 28];
1060
- _p = {};
1061
- return [4, deserializeAws_restJson1BadGatewayException_event(output["BadGatewayException"], context)];
1062
- case 27: return [2, (_p.BadGatewayException = _q.sent(),
1063
- _p)];
1064
- case 28: return [2, { $unknown: output }];
952
+ }); };
953
+ var deserializeAws_restJson1BadGatewayExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
954
+ var contents, data, exception;
955
+ return __generator(this, function (_a) {
956
+ contents = {};
957
+ data = parsedOutput.body;
958
+ if (data.message !== undefined && data.message !== null) {
959
+ contents.message = __expectString(data.message);
960
+ }
961
+ exception = new BadGatewayException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
962
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
963
+ });
964
+ }); };
965
+ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
966
+ var contents, data, exception;
967
+ return __generator(this, function (_a) {
968
+ contents = {};
969
+ data = parsedOutput.body;
970
+ if (data.message !== undefined && data.message !== null) {
971
+ contents.message = __expectString(data.message);
972
+ }
973
+ exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
974
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
975
+ });
976
+ }); };
977
+ var deserializeAws_restJson1DependencyFailedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
978
+ var contents, data, exception;
979
+ return __generator(this, function (_a) {
980
+ contents = {};
981
+ data = parsedOutput.body;
982
+ if (data.message !== undefined && data.message !== null) {
983
+ contents.message = __expectString(data.message);
984
+ }
985
+ exception = new DependencyFailedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
986
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
987
+ });
988
+ }); };
989
+ var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
990
+ var contents, data, exception;
991
+ return __generator(this, function (_a) {
992
+ contents = {};
993
+ data = parsedOutput.body;
994
+ if (data.message !== undefined && data.message !== null) {
995
+ contents.message = __expectString(data.message);
996
+ }
997
+ exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
998
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
999
+ });
1000
+ }); };
1001
+ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1002
+ var contents, data, exception;
1003
+ return __generator(this, function (_a) {
1004
+ contents = {};
1005
+ data = parsedOutput.body;
1006
+ if (data.message !== undefined && data.message !== null) {
1007
+ contents.message = __expectString(data.message);
1065
1008
  }
1009
+ exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1010
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
1066
1011
  });
1067
1012
  }); };
1013
+ var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1014
+ var contents, data, exception;
1015
+ return __generator(this, function (_a) {
1016
+ contents = {};
1017
+ data = parsedOutput.body;
1018
+ if (data.message !== undefined && data.message !== null) {
1019
+ contents.message = __expectString(data.message);
1020
+ }
1021
+ exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1022
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
1023
+ });
1024
+ }); };
1025
+ var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1026
+ var contents, data, exception;
1027
+ return __generator(this, function (_a) {
1028
+ contents = {};
1029
+ data = parsedOutput.body;
1030
+ if (data.message !== undefined && data.message !== null) {
1031
+ contents.message = __expectString(data.message);
1032
+ }
1033
+ exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1034
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
1035
+ });
1036
+ }); };
1037
+ var serializeAws_restJson1StartConversationRequestEventStream = function (input, context) {
1038
+ var eventMarshallingVisitor = function (event) {
1039
+ return StartConversationRequestEventStream.visit(event, {
1040
+ ConfigurationEvent: function (value) { return serializeAws_restJson1ConfigurationEvent_event(value, context); },
1041
+ AudioInputEvent: function (value) { return serializeAws_restJson1AudioInputEvent_event(value, context); },
1042
+ DTMFInputEvent: function (value) { return serializeAws_restJson1DTMFInputEvent_event(value, context); },
1043
+ TextInputEvent: function (value) { return serializeAws_restJson1TextInputEvent_event(value, context); },
1044
+ PlaybackCompletionEvent: function (value) { return serializeAws_restJson1PlaybackCompletionEvent_event(value, context); },
1045
+ DisconnectionEvent: function (value) { return serializeAws_restJson1DisconnectionEvent_event(value, context); },
1046
+ _: function (value) { return value; },
1047
+ });
1048
+ };
1049
+ return context.eventStreamMarshaller.serialize(input, eventMarshallingVisitor);
1050
+ };
1068
1051
  var serializeAws_restJson1AudioInputEvent_event = function (input, context) {
1069
- var message = {
1070
- headers: {
1071
- ":event-type": { type: "string", value: "AudioInputEvent" },
1072
- ":message-type": { type: "string", value: "event" },
1073
- ":content-type": { type: "string", value: "application/json" },
1074
- },
1075
- body: new Uint8Array(),
1052
+ var headers = {
1053
+ ":event-type": { type: "string", value: "AudioInputEvent" },
1054
+ ":message-type": { type: "string", value: "event" },
1055
+ ":content-type": { type: "string", value: "application/json" },
1076
1056
  };
1077
- var body = serializeAws_restJson1AudioInputEvent(input, context);
1078
- message.body = context.utf8Decoder(JSON.stringify(body));
1079
- return message;
1057
+ var body = new Uint8Array();
1058
+ body = serializeAws_restJson1AudioInputEvent(input, context);
1059
+ body = context.utf8Decoder(JSON.stringify(body));
1060
+ return { headers: headers, body: body };
1080
1061
  };
1081
1062
  var serializeAws_restJson1ConfigurationEvent_event = function (input, context) {
1082
- var message = {
1083
- headers: {
1084
- ":event-type": { type: "string", value: "ConfigurationEvent" },
1085
- ":message-type": { type: "string", value: "event" },
1086
- ":content-type": { type: "string", value: "application/json" },
1087
- },
1088
- body: new Uint8Array(),
1063
+ var headers = {
1064
+ ":event-type": { type: "string", value: "ConfigurationEvent" },
1065
+ ":message-type": { type: "string", value: "event" },
1066
+ ":content-type": { type: "string", value: "application/json" },
1089
1067
  };
1090
- var body = serializeAws_restJson1ConfigurationEvent(input, context);
1091
- message.body = context.utf8Decoder(JSON.stringify(body));
1092
- return message;
1068
+ var body = new Uint8Array();
1069
+ body = serializeAws_restJson1ConfigurationEvent(input, context);
1070
+ body = context.utf8Decoder(JSON.stringify(body));
1071
+ return { headers: headers, body: body };
1093
1072
  };
1094
1073
  var serializeAws_restJson1DisconnectionEvent_event = function (input, context) {
1095
- var message = {
1096
- headers: {
1097
- ":event-type": { type: "string", value: "DisconnectionEvent" },
1098
- ":message-type": { type: "string", value: "event" },
1099
- ":content-type": { type: "string", value: "application/json" },
1100
- },
1101
- body: new Uint8Array(),
1074
+ var headers = {
1075
+ ":event-type": { type: "string", value: "DisconnectionEvent" },
1076
+ ":message-type": { type: "string", value: "event" },
1077
+ ":content-type": { type: "string", value: "application/json" },
1102
1078
  };
1103
- var body = serializeAws_restJson1DisconnectionEvent(input, context);
1104
- message.body = context.utf8Decoder(JSON.stringify(body));
1105
- return message;
1079
+ var body = new Uint8Array();
1080
+ body = serializeAws_restJson1DisconnectionEvent(input, context);
1081
+ body = context.utf8Decoder(JSON.stringify(body));
1082
+ return { headers: headers, body: body };
1106
1083
  };
1107
1084
  var serializeAws_restJson1DTMFInputEvent_event = function (input, context) {
1108
- var message = {
1109
- headers: {
1110
- ":event-type": { type: "string", value: "DTMFInputEvent" },
1111
- ":message-type": { type: "string", value: "event" },
1112
- ":content-type": { type: "string", value: "application/json" },
1113
- },
1114
- body: new Uint8Array(),
1085
+ var headers = {
1086
+ ":event-type": { type: "string", value: "DTMFInputEvent" },
1087
+ ":message-type": { type: "string", value: "event" },
1088
+ ":content-type": { type: "string", value: "application/json" },
1115
1089
  };
1116
- var body = serializeAws_restJson1DTMFInputEvent(input, context);
1117
- message.body = context.utf8Decoder(JSON.stringify(body));
1118
- return message;
1090
+ var body = new Uint8Array();
1091
+ body = serializeAws_restJson1DTMFInputEvent(input, context);
1092
+ body = context.utf8Decoder(JSON.stringify(body));
1093
+ return { headers: headers, body: body };
1119
1094
  };
1120
1095
  var serializeAws_restJson1PlaybackCompletionEvent_event = function (input, context) {
1121
- var message = {
1122
- headers: {
1123
- ":event-type": { type: "string", value: "PlaybackCompletionEvent" },
1124
- ":message-type": { type: "string", value: "event" },
1125
- ":content-type": { type: "string", value: "application/json" },
1126
- },
1127
- body: new Uint8Array(),
1096
+ var headers = {
1097
+ ":event-type": { type: "string", value: "PlaybackCompletionEvent" },
1098
+ ":message-type": { type: "string", value: "event" },
1099
+ ":content-type": { type: "string", value: "application/json" },
1128
1100
  };
1129
- var body = serializeAws_restJson1PlaybackCompletionEvent(input, context);
1130
- message.body = context.utf8Decoder(JSON.stringify(body));
1131
- return message;
1101
+ var body = new Uint8Array();
1102
+ body = serializeAws_restJson1PlaybackCompletionEvent(input, context);
1103
+ body = context.utf8Decoder(JSON.stringify(body));
1104
+ return { headers: headers, body: body };
1132
1105
  };
1133
1106
  var serializeAws_restJson1TextInputEvent_event = function (input, context) {
1134
- var message = {
1135
- headers: {
1136
- ":event-type": { type: "string", value: "TextInputEvent" },
1137
- ":message-type": { type: "string", value: "event" },
1138
- ":content-type": { type: "string", value: "application/json" },
1139
- },
1140
- body: new Uint8Array(),
1107
+ var headers = {
1108
+ ":event-type": { type: "string", value: "TextInputEvent" },
1109
+ ":message-type": { type: "string", value: "event" },
1110
+ ":content-type": { type: "string", value: "application/json" },
1141
1111
  };
1142
- var body = serializeAws_restJson1TextInputEvent(input, context);
1143
- message.body = context.utf8Decoder(JSON.stringify(body));
1144
- return message;
1112
+ var body = new Uint8Array();
1113
+ body = serializeAws_restJson1TextInputEvent(input, context);
1114
+ body = context.utf8Decoder(JSON.stringify(body));
1115
+ return { headers: headers, body: body };
1116
+ };
1117
+ var deserializeAws_restJson1StartConversationResponseEventStream = function (output, context) {
1118
+ return context.eventStreamMarshaller.deserialize(output, function (event) { return __awaiter(void 0, void 0, void 0, function () {
1119
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
1120
+ return __generator(this, function (_q) {
1121
+ switch (_q.label) {
1122
+ case 0:
1123
+ if (!(event["PlaybackInterruptionEvent"] != null)) return [3, 2];
1124
+ _a = {};
1125
+ return [4, deserializeAws_restJson1PlaybackInterruptionEvent_event(event["PlaybackInterruptionEvent"], context)];
1126
+ case 1: return [2, (_a.PlaybackInterruptionEvent = _q.sent(),
1127
+ _a)];
1128
+ case 2:
1129
+ if (!(event["TranscriptEvent"] != null)) return [3, 4];
1130
+ _b = {};
1131
+ return [4, deserializeAws_restJson1TranscriptEvent_event(event["TranscriptEvent"], context)];
1132
+ case 3: return [2, (_b.TranscriptEvent = _q.sent(),
1133
+ _b)];
1134
+ case 4:
1135
+ if (!(event["IntentResultEvent"] != null)) return [3, 6];
1136
+ _c = {};
1137
+ return [4, deserializeAws_restJson1IntentResultEvent_event(event["IntentResultEvent"], context)];
1138
+ case 5: return [2, (_c.IntentResultEvent = _q.sent(),
1139
+ _c)];
1140
+ case 6:
1141
+ if (!(event["TextResponseEvent"] != null)) return [3, 8];
1142
+ _d = {};
1143
+ return [4, deserializeAws_restJson1TextResponseEvent_event(event["TextResponseEvent"], context)];
1144
+ case 7: return [2, (_d.TextResponseEvent = _q.sent(),
1145
+ _d)];
1146
+ case 8:
1147
+ if (!(event["AudioResponseEvent"] != null)) return [3, 10];
1148
+ _e = {};
1149
+ return [4, deserializeAws_restJson1AudioResponseEvent_event(event["AudioResponseEvent"], context)];
1150
+ case 9: return [2, (_e.AudioResponseEvent = _q.sent(),
1151
+ _e)];
1152
+ case 10:
1153
+ if (!(event["HeartbeatEvent"] != null)) return [3, 12];
1154
+ _f = {};
1155
+ return [4, deserializeAws_restJson1HeartbeatEvent_event(event["HeartbeatEvent"], context)];
1156
+ case 11: return [2, (_f.HeartbeatEvent = _q.sent(),
1157
+ _f)];
1158
+ case 12:
1159
+ if (!(event["AccessDeniedException"] != null)) return [3, 14];
1160
+ _g = {};
1161
+ return [4, deserializeAws_restJson1AccessDeniedException_event(event["AccessDeniedException"], context)];
1162
+ case 13: return [2, (_g.AccessDeniedException = _q.sent(),
1163
+ _g)];
1164
+ case 14:
1165
+ if (!(event["ResourceNotFoundException"] != null)) return [3, 16];
1166
+ _h = {};
1167
+ return [4, deserializeAws_restJson1ResourceNotFoundException_event(event["ResourceNotFoundException"], context)];
1168
+ case 15: return [2, (_h.ResourceNotFoundException = _q.sent(),
1169
+ _h)];
1170
+ case 16:
1171
+ if (!(event["ValidationException"] != null)) return [3, 18];
1172
+ _j = {};
1173
+ return [4, deserializeAws_restJson1ValidationException_event(event["ValidationException"], context)];
1174
+ case 17: return [2, (_j.ValidationException = _q.sent(),
1175
+ _j)];
1176
+ case 18:
1177
+ if (!(event["ThrottlingException"] != null)) return [3, 20];
1178
+ _k = {};
1179
+ return [4, deserializeAws_restJson1ThrottlingException_event(event["ThrottlingException"], context)];
1180
+ case 19: return [2, (_k.ThrottlingException = _q.sent(),
1181
+ _k)];
1182
+ case 20:
1183
+ if (!(event["InternalServerException"] != null)) return [3, 22];
1184
+ _l = {};
1185
+ return [4, deserializeAws_restJson1InternalServerException_event(event["InternalServerException"], context)];
1186
+ case 21: return [2, (_l.InternalServerException = _q.sent(),
1187
+ _l)];
1188
+ case 22:
1189
+ if (!(event["ConflictException"] != null)) return [3, 24];
1190
+ _m = {};
1191
+ return [4, deserializeAws_restJson1ConflictException_event(event["ConflictException"], context)];
1192
+ case 23: return [2, (_m.ConflictException = _q.sent(),
1193
+ _m)];
1194
+ case 24:
1195
+ if (!(event["DependencyFailedException"] != null)) return [3, 26];
1196
+ _o = {};
1197
+ return [4, deserializeAws_restJson1DependencyFailedException_event(event["DependencyFailedException"], context)];
1198
+ case 25: return [2, (_o.DependencyFailedException = _q.sent(),
1199
+ _o)];
1200
+ case 26:
1201
+ if (!(event["BadGatewayException"] != null)) return [3, 28];
1202
+ _p = {};
1203
+ return [4, deserializeAws_restJson1BadGatewayException_event(event["BadGatewayException"], context)];
1204
+ case 27: return [2, (_p.BadGatewayException = _q.sent(),
1205
+ _p)];
1206
+ case 28: return [2, { $unknown: output }];
1207
+ }
1208
+ });
1209
+ }); });
1145
1210
  };
1146
1211
  var deserializeAws_restJson1AccessDeniedException_event = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1147
1212
  var parsedOutput, _a;
@@ -1167,7 +1232,7 @@ var deserializeAws_restJson1AudioResponseEvent_event = function (output, context
1167
1232
  return [4, parseBody(output.body, context)];
1168
1233
  case 1:
1169
1234
  data = _a.sent();
1170
- contents = __assign(__assign({}, contents), deserializeAws_restJson1AudioResponseEvent(data, context));
1235
+ Object.assign(contents, deserializeAws_restJson1AudioResponseEvent(data, context));
1171
1236
  return [2, contents];
1172
1237
  }
1173
1238
  });
@@ -1226,7 +1291,7 @@ var deserializeAws_restJson1HeartbeatEvent_event = function (output, context) {
1226
1291
  return [4, parseBody(output.body, context)];
1227
1292
  case 1:
1228
1293
  data = _a.sent();
1229
- contents = __assign(__assign({}, contents), deserializeAws_restJson1HeartbeatEvent(data, context));
1294
+ Object.assign(contents, deserializeAws_restJson1HeartbeatEvent(data, context));
1230
1295
  return [2, contents];
1231
1296
  }
1232
1297
  });
@@ -1240,7 +1305,7 @@ var deserializeAws_restJson1IntentResultEvent_event = function (output, context)
1240
1305
  return [4, parseBody(output.body, context)];
1241
1306
  case 1:
1242
1307
  data = _a.sent();
1243
- contents = __assign(__assign({}, contents), deserializeAws_restJson1IntentResultEvent(data, context));
1308
+ Object.assign(contents, deserializeAws_restJson1IntentResultEvent(data, context));
1244
1309
  return [2, contents];
1245
1310
  }
1246
1311
  });
@@ -1269,7 +1334,7 @@ var deserializeAws_restJson1PlaybackInterruptionEvent_event = function (output,
1269
1334
  return [4, parseBody(output.body, context)];
1270
1335
  case 1:
1271
1336
  data = _a.sent();
1272
- contents = __assign(__assign({}, contents), deserializeAws_restJson1PlaybackInterruptionEvent(data, context));
1337
+ Object.assign(contents, deserializeAws_restJson1PlaybackInterruptionEvent(data, context));
1273
1338
  return [2, contents];
1274
1339
  }
1275
1340
  });
@@ -1298,7 +1363,7 @@ var deserializeAws_restJson1TextResponseEvent_event = function (output, context)
1298
1363
  return [4, parseBody(output.body, context)];
1299
1364
  case 1:
1300
1365
  data = _a.sent();
1301
- contents = __assign(__assign({}, contents), deserializeAws_restJson1TextResponseEvent(data, context));
1366
+ Object.assign(contents, deserializeAws_restJson1TextResponseEvent(data, context));
1302
1367
  return [2, contents];
1303
1368
  }
1304
1369
  });
@@ -1327,7 +1392,7 @@ var deserializeAws_restJson1TranscriptEvent_event = function (output, context) {
1327
1392
  return [4, parseBody(output.body, context)];
1328
1393
  case 1:
1329
1394
  data = _a.sent();
1330
- contents = __assign(__assign({}, contents), deserializeAws_restJson1TranscriptEvent(data, context));
1395
+ Object.assign(contents, deserializeAws_restJson1TranscriptEvent(data, context));
1331
1396
  return [2, contents];
1332
1397
  }
1333
1398
  });
@@ -1347,102 +1412,6 @@ var deserializeAws_restJson1ValidationException_event = function (output, contex
1347
1412
  }
1348
1413
  });
1349
1414
  }); };
1350
- var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1351
- var contents, data, exception;
1352
- return __generator(this, function (_a) {
1353
- contents = {};
1354
- data = parsedOutput.body;
1355
- if (data.message !== undefined && data.message !== null) {
1356
- contents.message = __expectString(data.message);
1357
- }
1358
- exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1359
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1360
- });
1361
- }); };
1362
- var deserializeAws_restJson1BadGatewayExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1363
- var contents, data, exception;
1364
- return __generator(this, function (_a) {
1365
- contents = {};
1366
- data = parsedOutput.body;
1367
- if (data.message !== undefined && data.message !== null) {
1368
- contents.message = __expectString(data.message);
1369
- }
1370
- exception = new BadGatewayException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1371
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1372
- });
1373
- }); };
1374
- var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1375
- var contents, data, exception;
1376
- return __generator(this, function (_a) {
1377
- contents = {};
1378
- data = parsedOutput.body;
1379
- if (data.message !== undefined && data.message !== null) {
1380
- contents.message = __expectString(data.message);
1381
- }
1382
- exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1383
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1384
- });
1385
- }); };
1386
- var deserializeAws_restJson1DependencyFailedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1387
- var contents, data, exception;
1388
- return __generator(this, function (_a) {
1389
- contents = {};
1390
- data = parsedOutput.body;
1391
- if (data.message !== undefined && data.message !== null) {
1392
- contents.message = __expectString(data.message);
1393
- }
1394
- exception = new DependencyFailedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1395
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1396
- });
1397
- }); };
1398
- var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1399
- var contents, data, exception;
1400
- return __generator(this, function (_a) {
1401
- contents = {};
1402
- data = parsedOutput.body;
1403
- if (data.message !== undefined && data.message !== null) {
1404
- contents.message = __expectString(data.message);
1405
- }
1406
- exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1407
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1408
- });
1409
- }); };
1410
- var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1411
- var contents, data, exception;
1412
- return __generator(this, function (_a) {
1413
- contents = {};
1414
- data = parsedOutput.body;
1415
- if (data.message !== undefined && data.message !== null) {
1416
- contents.message = __expectString(data.message);
1417
- }
1418
- exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1419
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1420
- });
1421
- }); };
1422
- var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1423
- var contents, data, exception;
1424
- return __generator(this, function (_a) {
1425
- contents = {};
1426
- data = parsedOutput.body;
1427
- if (data.message !== undefined && data.message !== null) {
1428
- contents.message = __expectString(data.message);
1429
- }
1430
- exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1431
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1432
- });
1433
- }); };
1434
- var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1435
- var contents, data, exception;
1436
- return __generator(this, function (_a) {
1437
- contents = {};
1438
- data = parsedOutput.body;
1439
- if (data.message !== undefined && data.message !== null) {
1440
- contents.message = __expectString(data.message);
1441
- }
1442
- exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1443
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1444
- });
1445
- }); };
1446
1415
  var serializeAws_restJson1ActiveContext = function (input, context) {
1447
1416
  return __assign(__assign(__assign({}, (input.contextAttributes != null && {
1448
1417
  contextAttributes: serializeAws_restJson1ActiveContextParametersMap(input.contextAttributes, context),
@@ -1596,19 +1565,6 @@ var serializeAws_restJson1Slots = function (input, context) {
1596
1565
  return __assign(__assign({}, acc), (_b = {}, _b[key] = serializeAws_restJson1Slot(value, context), _b));
1597
1566
  }, {});
1598
1567
  };
1599
- var serializeAws_restJson1StartConversationRequestEventStream = function (input, context) {
1600
- return StartConversationRequestEventStream.visit(input, {
1601
- AudioInputEvent: function (value) { return ({ AudioInputEvent: serializeAws_restJson1AudioInputEvent(value, context) }); },
1602
- ConfigurationEvent: function (value) { return ({ ConfigurationEvent: serializeAws_restJson1ConfigurationEvent(value, context) }); },
1603
- DTMFInputEvent: function (value) { return ({ DTMFInputEvent: serializeAws_restJson1DTMFInputEvent(value, context) }); },
1604
- DisconnectionEvent: function (value) { return ({ DisconnectionEvent: serializeAws_restJson1DisconnectionEvent(value, context) }); },
1605
- PlaybackCompletionEvent: function (value) { return ({
1606
- PlaybackCompletionEvent: serializeAws_restJson1PlaybackCompletionEvent(value, context),
1607
- }); },
1608
- TextInputEvent: function (value) { return ({ TextInputEvent: serializeAws_restJson1TextInputEvent(value, context) }); },
1609
- _: function (name, value) { return ({ name: value }); },
1610
- });
1611
- };
1612
1568
  var serializeAws_restJson1StringList = function (input, context) {
1613
1569
  return input
1614
1570
  .filter(function (e) { return e != null; })
@@ -1647,11 +1603,6 @@ var serializeAws_restJson1Values = function (input, context) {
1647
1603
  return serializeAws_restJson1Slot(entry, context);
1648
1604
  });
1649
1605
  };
1650
- var deserializeAws_restJson1AccessDeniedException = function (output, context) {
1651
- return {
1652
- message: __expectString(output.message),
1653
- };
1654
- };
1655
1606
  var deserializeAws_restJson1ActiveContext = function (output, context) {
1656
1607
  return {
1657
1608
  contextAttributes: output.contextAttributes != null
@@ -1697,11 +1648,6 @@ var deserializeAws_restJson1AudioResponseEvent = function (output, context) {
1697
1648
  eventId: __expectString(output.eventId),
1698
1649
  };
1699
1650
  };
1700
- var deserializeAws_restJson1BadGatewayException = function (output, context) {
1701
- return {
1702
- message: __expectString(output.message),
1703
- };
1704
- };
1705
1651
  var deserializeAws_restJson1Button = function (output, context) {
1706
1652
  return {
1707
1653
  text: __expectString(output.text),
@@ -1724,16 +1670,6 @@ var deserializeAws_restJson1ConfidenceScore = function (output, context) {
1724
1670
  score: __limitedParseDouble(output.score),
1725
1671
  };
1726
1672
  };
1727
- var deserializeAws_restJson1ConflictException = function (output, context) {
1728
- return {
1729
- message: __expectString(output.message),
1730
- };
1731
- };
1732
- var deserializeAws_restJson1DependencyFailedException = function (output, context) {
1733
- return {
1734
- message: __expectString(output.message),
1735
- };
1736
- };
1737
1673
  var deserializeAws_restJson1DialogAction = function (output, context) {
1738
1674
  return {
1739
1675
  slotElicitationStyle: __expectString(output.slotElicitationStyle),
@@ -1776,11 +1712,6 @@ var deserializeAws_restJson1IntentResultEvent = function (output, context) {
1776
1712
  sessionState: output.sessionState != null ? deserializeAws_restJson1SessionState(output.sessionState, context) : undefined,
1777
1713
  };
1778
1714
  };
1779
- var deserializeAws_restJson1InternalServerException = function (output, context) {
1780
- return {
1781
- message: __expectString(output.message),
1782
- };
1783
- };
1784
1715
  var deserializeAws_restJson1Interpretation = function (output, context) {
1785
1716
  return {
1786
1717
  intent: output.intent != null ? deserializeAws_restJson1Intent(output.intent, context) : undefined,
@@ -1828,11 +1759,6 @@ var deserializeAws_restJson1PlaybackInterruptionEvent = function (output, contex
1828
1759
  eventReason: __expectString(output.eventReason),
1829
1760
  };
1830
1761
  };
1831
- var deserializeAws_restJson1ResourceNotFoundException = function (output, context) {
1832
- return {
1833
- message: __expectString(output.message),
1834
- };
1835
- };
1836
1762
  var deserializeAws_restJson1RuntimeHintDetails = function (output, context) {
1837
1763
  return {
1838
1764
  runtimeHintValues: output.runtimeHintValues != null
@@ -1928,79 +1854,6 @@ var deserializeAws_restJson1Slots = function (output, context) {
1928
1854
  return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1Slot(value, context), _b));
1929
1855
  }, {});
1930
1856
  };
1931
- var deserializeAws_restJson1StartConversationResponseEventStream = function (output, context) {
1932
- if (output.AccessDeniedException !== undefined && output.AccessDeniedException !== null) {
1933
- return {
1934
- AccessDeniedException: deserializeAws_restJson1AccessDeniedException(output.AccessDeniedException, context),
1935
- };
1936
- }
1937
- if (output.AudioResponseEvent !== undefined && output.AudioResponseEvent !== null) {
1938
- return {
1939
- AudioResponseEvent: deserializeAws_restJson1AudioResponseEvent(output.AudioResponseEvent, context),
1940
- };
1941
- }
1942
- if (output.BadGatewayException !== undefined && output.BadGatewayException !== null) {
1943
- return {
1944
- BadGatewayException: deserializeAws_restJson1BadGatewayException(output.BadGatewayException, context),
1945
- };
1946
- }
1947
- if (output.ConflictException !== undefined && output.ConflictException !== null) {
1948
- return {
1949
- ConflictException: deserializeAws_restJson1ConflictException(output.ConflictException, context),
1950
- };
1951
- }
1952
- if (output.DependencyFailedException !== undefined && output.DependencyFailedException !== null) {
1953
- return {
1954
- DependencyFailedException: deserializeAws_restJson1DependencyFailedException(output.DependencyFailedException, context),
1955
- };
1956
- }
1957
- if (output.HeartbeatEvent !== undefined && output.HeartbeatEvent !== null) {
1958
- return {
1959
- HeartbeatEvent: deserializeAws_restJson1HeartbeatEvent(output.HeartbeatEvent, context),
1960
- };
1961
- }
1962
- if (output.IntentResultEvent !== undefined && output.IntentResultEvent !== null) {
1963
- return {
1964
- IntentResultEvent: deserializeAws_restJson1IntentResultEvent(output.IntentResultEvent, context),
1965
- };
1966
- }
1967
- if (output.InternalServerException !== undefined && output.InternalServerException !== null) {
1968
- return {
1969
- InternalServerException: deserializeAws_restJson1InternalServerException(output.InternalServerException, context),
1970
- };
1971
- }
1972
- if (output.PlaybackInterruptionEvent !== undefined && output.PlaybackInterruptionEvent !== null) {
1973
- return {
1974
- PlaybackInterruptionEvent: deserializeAws_restJson1PlaybackInterruptionEvent(output.PlaybackInterruptionEvent, context),
1975
- };
1976
- }
1977
- if (output.ResourceNotFoundException !== undefined && output.ResourceNotFoundException !== null) {
1978
- return {
1979
- ResourceNotFoundException: deserializeAws_restJson1ResourceNotFoundException(output.ResourceNotFoundException, context),
1980
- };
1981
- }
1982
- if (output.TextResponseEvent !== undefined && output.TextResponseEvent !== null) {
1983
- return {
1984
- TextResponseEvent: deserializeAws_restJson1TextResponseEvent(output.TextResponseEvent, context),
1985
- };
1986
- }
1987
- if (output.ThrottlingException !== undefined && output.ThrottlingException !== null) {
1988
- return {
1989
- ThrottlingException: deserializeAws_restJson1ThrottlingException(output.ThrottlingException, context),
1990
- };
1991
- }
1992
- if (output.TranscriptEvent !== undefined && output.TranscriptEvent !== null) {
1993
- return {
1994
- TranscriptEvent: deserializeAws_restJson1TranscriptEvent(output.TranscriptEvent, context),
1995
- };
1996
- }
1997
- if (output.ValidationException !== undefined && output.ValidationException !== null) {
1998
- return {
1999
- ValidationException: deserializeAws_restJson1ValidationException(output.ValidationException, context),
2000
- };
2001
- }
2002
- return { $unknown: Object.entries(output)[0] };
2003
- };
2004
1857
  var deserializeAws_restJson1StringList = function (output, context) {
2005
1858
  var retVal = (output || [])
2006
1859
  .filter(function (e) { return e != null; })
@@ -2028,22 +1881,12 @@ var deserializeAws_restJson1TextResponseEvent = function (output, context) {
2028
1881
  messages: output.messages != null ? deserializeAws_restJson1Messages(output.messages, context) : undefined,
2029
1882
  };
2030
1883
  };
2031
- var deserializeAws_restJson1ThrottlingException = function (output, context) {
2032
- return {
2033
- message: __expectString(output.message),
2034
- };
2035
- };
2036
1884
  var deserializeAws_restJson1TranscriptEvent = function (output, context) {
2037
1885
  return {
2038
1886
  eventId: __expectString(output.eventId),
2039
1887
  transcript: __expectString(output.transcript),
2040
1888
  };
2041
1889
  };
2042
- var deserializeAws_restJson1ValidationException = function (output, context) {
2043
- return {
2044
- message: __expectString(output.message),
2045
- };
2046
- };
2047
1890
  var deserializeAws_restJson1Value = function (output, context) {
2048
1891
  return {
2049
1892
  interpretedValue: __expectString(output.interpretedValue),