@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.
@@ -378,7 +378,7 @@ const serializeAws_restJson1StartConversationCommand = async (input, context) =>
378
378
  }
379
379
  let body;
380
380
  if (input.requestEventStream !== undefined) {
381
- body = context.eventStreamMarshaller.serialize(input.requestEventStream, (event) => serializeAws_restJson1StartConversationRequestEventStream_event(event, context));
381
+ body = serializeAws_restJson1StartConversationRequestEventStream(input.requestEventStream, context);
382
382
  }
383
383
  return new protocol_http_1.HttpRequest({
384
384
  protocol,
@@ -767,22 +767,8 @@ const deserializeAws_restJson1StartConversationCommand = async (output, context)
767
767
  $metadata: deserializeMetadata(output),
768
768
  responseEventStream: undefined,
769
769
  };
770
- const data = context.eventStreamMarshaller.deserialize(output.body, async (event) => {
771
- const eventName = Object.keys(event)[0];
772
- const eventHeaders = Object.entries(event[eventName].headers).reduce((accummulator, curr) => {
773
- accummulator[curr[0]] = curr[1].value;
774
- return accummulator;
775
- }, {});
776
- const eventMessage = {
777
- headers: eventHeaders,
778
- body: event[eventName].body,
779
- };
780
- const parsedEvent = {
781
- [eventName]: eventMessage,
782
- };
783
- return await deserializeAws_restJson1StartConversationResponseEventStream_event(parsedEvent, context);
784
- });
785
- contents.responseEventStream = data;
770
+ const data = output.body;
771
+ contents.responseEventStream = deserializeAws_restJson1StartConversationResponseEventStream(data, context);
786
772
  return Promise.resolve(contents);
787
773
  };
788
774
  exports.deserializeAws_restJson1StartConversationCommand = deserializeAws_restJson1StartConversationCommand;
@@ -818,167 +804,254 @@ const deserializeAws_restJson1StartConversationCommandError = async (output, con
818
804
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
819
805
  }
820
806
  };
821
- const serializeAws_restJson1StartConversationRequestEventStream_event = (input, context) => {
822
- return models_0_1.StartConversationRequestEventStream.visit(input, {
823
- ConfigurationEvent: (value) => serializeAws_restJson1ConfigurationEvent_event(value, context),
824
- AudioInputEvent: (value) => serializeAws_restJson1AudioInputEvent_event(value, context),
825
- DTMFInputEvent: (value) => serializeAws_restJson1DTMFInputEvent_event(value, context),
826
- TextInputEvent: (value) => serializeAws_restJson1TextInputEvent_event(value, context),
827
- PlaybackCompletionEvent: (value) => serializeAws_restJson1PlaybackCompletionEvent_event(value, context),
828
- DisconnectionEvent: (value) => serializeAws_restJson1DisconnectionEvent_event(value, context),
829
- _: (value) => value,
807
+ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
808
+ const contents = {};
809
+ const data = parsedOutput.body;
810
+ if (data.message !== undefined && data.message !== null) {
811
+ contents.message = (0, smithy_client_1.expectString)(data.message);
812
+ }
813
+ const exception = new models_0_1.AccessDeniedException({
814
+ $metadata: deserializeMetadata(parsedOutput),
815
+ ...contents,
830
816
  });
817
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
831
818
  };
832
- const deserializeAws_restJson1StartConversationResponseEventStream_event = async (output, context) => {
833
- if (output["PlaybackInterruptionEvent"] !== undefined) {
834
- return {
835
- PlaybackInterruptionEvent: await deserializeAws_restJson1PlaybackInterruptionEvent_event(output["PlaybackInterruptionEvent"], context),
836
- };
837
- }
838
- if (output["TranscriptEvent"] !== undefined) {
839
- return {
840
- TranscriptEvent: await deserializeAws_restJson1TranscriptEvent_event(output["TranscriptEvent"], context),
841
- };
842
- }
843
- if (output["IntentResultEvent"] !== undefined) {
844
- return {
845
- IntentResultEvent: await deserializeAws_restJson1IntentResultEvent_event(output["IntentResultEvent"], context),
846
- };
847
- }
848
- if (output["TextResponseEvent"] !== undefined) {
849
- return {
850
- TextResponseEvent: await deserializeAws_restJson1TextResponseEvent_event(output["TextResponseEvent"], context),
851
- };
852
- }
853
- if (output["AudioResponseEvent"] !== undefined) {
854
- return {
855
- AudioResponseEvent: await deserializeAws_restJson1AudioResponseEvent_event(output["AudioResponseEvent"], context),
856
- };
857
- }
858
- if (output["HeartbeatEvent"] !== undefined) {
859
- return {
860
- HeartbeatEvent: await deserializeAws_restJson1HeartbeatEvent_event(output["HeartbeatEvent"], context),
861
- };
862
- }
863
- if (output["AccessDeniedException"] !== undefined) {
864
- return {
865
- AccessDeniedException: await deserializeAws_restJson1AccessDeniedException_event(output["AccessDeniedException"], context),
866
- };
867
- }
868
- if (output["ResourceNotFoundException"] !== undefined) {
869
- return {
870
- ResourceNotFoundException: await deserializeAws_restJson1ResourceNotFoundException_event(output["ResourceNotFoundException"], context),
871
- };
819
+ const deserializeAws_restJson1BadGatewayExceptionResponse = async (parsedOutput, context) => {
820
+ const contents = {};
821
+ const data = parsedOutput.body;
822
+ if (data.message !== undefined && data.message !== null) {
823
+ contents.message = (0, smithy_client_1.expectString)(data.message);
872
824
  }
873
- if (output["ValidationException"] !== undefined) {
874
- return {
875
- ValidationException: await deserializeAws_restJson1ValidationException_event(output["ValidationException"], context),
876
- };
825
+ const exception = new models_0_1.BadGatewayException({
826
+ $metadata: deserializeMetadata(parsedOutput),
827
+ ...contents,
828
+ });
829
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
830
+ };
831
+ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
832
+ const contents = {};
833
+ const data = parsedOutput.body;
834
+ if (data.message !== undefined && data.message !== null) {
835
+ contents.message = (0, smithy_client_1.expectString)(data.message);
877
836
  }
878
- if (output["ThrottlingException"] !== undefined) {
879
- return {
880
- ThrottlingException: await deserializeAws_restJson1ThrottlingException_event(output["ThrottlingException"], context),
881
- };
837
+ const exception = new models_0_1.ConflictException({
838
+ $metadata: deserializeMetadata(parsedOutput),
839
+ ...contents,
840
+ });
841
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
842
+ };
843
+ const deserializeAws_restJson1DependencyFailedExceptionResponse = async (parsedOutput, context) => {
844
+ const contents = {};
845
+ const data = parsedOutput.body;
846
+ if (data.message !== undefined && data.message !== null) {
847
+ contents.message = (0, smithy_client_1.expectString)(data.message);
882
848
  }
883
- if (output["InternalServerException"] !== undefined) {
884
- return {
885
- InternalServerException: await deserializeAws_restJson1InternalServerException_event(output["InternalServerException"], context),
886
- };
849
+ const exception = new models_0_1.DependencyFailedException({
850
+ $metadata: deserializeMetadata(parsedOutput),
851
+ ...contents,
852
+ });
853
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
854
+ };
855
+ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
856
+ const contents = {};
857
+ const data = parsedOutput.body;
858
+ if (data.message !== undefined && data.message !== null) {
859
+ contents.message = (0, smithy_client_1.expectString)(data.message);
887
860
  }
888
- if (output["ConflictException"] !== undefined) {
889
- return {
890
- ConflictException: await deserializeAws_restJson1ConflictException_event(output["ConflictException"], context),
891
- };
861
+ const exception = new models_0_1.InternalServerException({
862
+ $metadata: deserializeMetadata(parsedOutput),
863
+ ...contents,
864
+ });
865
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
866
+ };
867
+ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
868
+ const contents = {};
869
+ const data = parsedOutput.body;
870
+ if (data.message !== undefined && data.message !== null) {
871
+ contents.message = (0, smithy_client_1.expectString)(data.message);
892
872
  }
893
- if (output["DependencyFailedException"] !== undefined) {
894
- return {
895
- DependencyFailedException: await deserializeAws_restJson1DependencyFailedException_event(output["DependencyFailedException"], context),
896
- };
873
+ const exception = new models_0_1.ResourceNotFoundException({
874
+ $metadata: deserializeMetadata(parsedOutput),
875
+ ...contents,
876
+ });
877
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
878
+ };
879
+ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
880
+ const contents = {};
881
+ const data = parsedOutput.body;
882
+ if (data.message !== undefined && data.message !== null) {
883
+ contents.message = (0, smithy_client_1.expectString)(data.message);
897
884
  }
898
- if (output["BadGatewayException"] !== undefined) {
899
- return {
900
- BadGatewayException: await deserializeAws_restJson1BadGatewayException_event(output["BadGatewayException"], context),
901
- };
885
+ const exception = new models_0_1.ThrottlingException({
886
+ $metadata: deserializeMetadata(parsedOutput),
887
+ ...contents,
888
+ });
889
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
890
+ };
891
+ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
892
+ const contents = {};
893
+ const data = parsedOutput.body;
894
+ if (data.message !== undefined && data.message !== null) {
895
+ contents.message = (0, smithy_client_1.expectString)(data.message);
902
896
  }
903
- return { $unknown: output };
897
+ const exception = new models_0_1.ValidationException({
898
+ $metadata: deserializeMetadata(parsedOutput),
899
+ ...contents,
900
+ });
901
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
902
+ };
903
+ const serializeAws_restJson1StartConversationRequestEventStream = (input, context) => {
904
+ const eventMarshallingVisitor = (event) => models_0_1.StartConversationRequestEventStream.visit(event, {
905
+ ConfigurationEvent: (value) => serializeAws_restJson1ConfigurationEvent_event(value, context),
906
+ AudioInputEvent: (value) => serializeAws_restJson1AudioInputEvent_event(value, context),
907
+ DTMFInputEvent: (value) => serializeAws_restJson1DTMFInputEvent_event(value, context),
908
+ TextInputEvent: (value) => serializeAws_restJson1TextInputEvent_event(value, context),
909
+ PlaybackCompletionEvent: (value) => serializeAws_restJson1PlaybackCompletionEvent_event(value, context),
910
+ DisconnectionEvent: (value) => serializeAws_restJson1DisconnectionEvent_event(value, context),
911
+ _: (value) => value,
912
+ });
913
+ return context.eventStreamMarshaller.serialize(input, eventMarshallingVisitor);
904
914
  };
905
915
  const serializeAws_restJson1AudioInputEvent_event = (input, context) => {
906
- const message = {
907
- headers: {
908
- ":event-type": { type: "string", value: "AudioInputEvent" },
909
- ":message-type": { type: "string", value: "event" },
910
- ":content-type": { type: "string", value: "application/json" },
911
- },
912
- body: new Uint8Array(),
913
- };
914
- const body = serializeAws_restJson1AudioInputEvent(input, context);
915
- message.body = context.utf8Decoder(JSON.stringify(body));
916
- return message;
916
+ const headers = {
917
+ ":event-type": { type: "string", value: "AudioInputEvent" },
918
+ ":message-type": { type: "string", value: "event" },
919
+ ":content-type": { type: "string", value: "application/json" },
920
+ };
921
+ let body = new Uint8Array();
922
+ body = serializeAws_restJson1AudioInputEvent(input, context);
923
+ body = context.utf8Decoder(JSON.stringify(body));
924
+ return { headers, body };
917
925
  };
918
926
  const serializeAws_restJson1ConfigurationEvent_event = (input, context) => {
919
- const message = {
920
- headers: {
921
- ":event-type": { type: "string", value: "ConfigurationEvent" },
922
- ":message-type": { type: "string", value: "event" },
923
- ":content-type": { type: "string", value: "application/json" },
924
- },
925
- body: new Uint8Array(),
926
- };
927
- const body = serializeAws_restJson1ConfigurationEvent(input, context);
928
- message.body = context.utf8Decoder(JSON.stringify(body));
929
- return message;
927
+ const headers = {
928
+ ":event-type": { type: "string", value: "ConfigurationEvent" },
929
+ ":message-type": { type: "string", value: "event" },
930
+ ":content-type": { type: "string", value: "application/json" },
931
+ };
932
+ let body = new Uint8Array();
933
+ body = serializeAws_restJson1ConfigurationEvent(input, context);
934
+ body = context.utf8Decoder(JSON.stringify(body));
935
+ return { headers, body };
930
936
  };
931
937
  const serializeAws_restJson1DisconnectionEvent_event = (input, context) => {
932
- const message = {
933
- headers: {
934
- ":event-type": { type: "string", value: "DisconnectionEvent" },
935
- ":message-type": { type: "string", value: "event" },
936
- ":content-type": { type: "string", value: "application/json" },
937
- },
938
- body: new Uint8Array(),
939
- };
940
- const body = serializeAws_restJson1DisconnectionEvent(input, context);
941
- message.body = context.utf8Decoder(JSON.stringify(body));
942
- return message;
938
+ const headers = {
939
+ ":event-type": { type: "string", value: "DisconnectionEvent" },
940
+ ":message-type": { type: "string", value: "event" },
941
+ ":content-type": { type: "string", value: "application/json" },
942
+ };
943
+ let body = new Uint8Array();
944
+ body = serializeAws_restJson1DisconnectionEvent(input, context);
945
+ body = context.utf8Decoder(JSON.stringify(body));
946
+ return { headers, body };
943
947
  };
944
948
  const serializeAws_restJson1DTMFInputEvent_event = (input, context) => {
945
- const message = {
946
- headers: {
947
- ":event-type": { type: "string", value: "DTMFInputEvent" },
948
- ":message-type": { type: "string", value: "event" },
949
- ":content-type": { type: "string", value: "application/json" },
950
- },
951
- body: new Uint8Array(),
952
- };
953
- const body = serializeAws_restJson1DTMFInputEvent(input, context);
954
- message.body = context.utf8Decoder(JSON.stringify(body));
955
- return message;
949
+ const headers = {
950
+ ":event-type": { type: "string", value: "DTMFInputEvent" },
951
+ ":message-type": { type: "string", value: "event" },
952
+ ":content-type": { type: "string", value: "application/json" },
953
+ };
954
+ let body = new Uint8Array();
955
+ body = serializeAws_restJson1DTMFInputEvent(input, context);
956
+ body = context.utf8Decoder(JSON.stringify(body));
957
+ return { headers, body };
956
958
  };
957
959
  const serializeAws_restJson1PlaybackCompletionEvent_event = (input, context) => {
958
- const message = {
959
- headers: {
960
- ":event-type": { type: "string", value: "PlaybackCompletionEvent" },
961
- ":message-type": { type: "string", value: "event" },
962
- ":content-type": { type: "string", value: "application/json" },
963
- },
964
- body: new Uint8Array(),
965
- };
966
- const body = serializeAws_restJson1PlaybackCompletionEvent(input, context);
967
- message.body = context.utf8Decoder(JSON.stringify(body));
968
- return message;
960
+ const headers = {
961
+ ":event-type": { type: "string", value: "PlaybackCompletionEvent" },
962
+ ":message-type": { type: "string", value: "event" },
963
+ ":content-type": { type: "string", value: "application/json" },
964
+ };
965
+ let body = new Uint8Array();
966
+ body = serializeAws_restJson1PlaybackCompletionEvent(input, context);
967
+ body = context.utf8Decoder(JSON.stringify(body));
968
+ return { headers, body };
969
969
  };
970
970
  const serializeAws_restJson1TextInputEvent_event = (input, context) => {
971
- const message = {
972
- headers: {
973
- ":event-type": { type: "string", value: "TextInputEvent" },
974
- ":message-type": { type: "string", value: "event" },
975
- ":content-type": { type: "string", value: "application/json" },
976
- },
977
- body: new Uint8Array(),
978
- };
979
- const body = serializeAws_restJson1TextInputEvent(input, context);
980
- message.body = context.utf8Decoder(JSON.stringify(body));
981
- return message;
971
+ const headers = {
972
+ ":event-type": { type: "string", value: "TextInputEvent" },
973
+ ":message-type": { type: "string", value: "event" },
974
+ ":content-type": { type: "string", value: "application/json" },
975
+ };
976
+ let body = new Uint8Array();
977
+ body = serializeAws_restJson1TextInputEvent(input, context);
978
+ body = context.utf8Decoder(JSON.stringify(body));
979
+ return { headers, body };
980
+ };
981
+ const deserializeAws_restJson1StartConversationResponseEventStream = (output, context) => {
982
+ return context.eventStreamMarshaller.deserialize(output, async (event) => {
983
+ if (event["PlaybackInterruptionEvent"] != null) {
984
+ return {
985
+ PlaybackInterruptionEvent: await deserializeAws_restJson1PlaybackInterruptionEvent_event(event["PlaybackInterruptionEvent"], context),
986
+ };
987
+ }
988
+ if (event["TranscriptEvent"] != null) {
989
+ return {
990
+ TranscriptEvent: await deserializeAws_restJson1TranscriptEvent_event(event["TranscriptEvent"], context),
991
+ };
992
+ }
993
+ if (event["IntentResultEvent"] != null) {
994
+ return {
995
+ IntentResultEvent: await deserializeAws_restJson1IntentResultEvent_event(event["IntentResultEvent"], context),
996
+ };
997
+ }
998
+ if (event["TextResponseEvent"] != null) {
999
+ return {
1000
+ TextResponseEvent: await deserializeAws_restJson1TextResponseEvent_event(event["TextResponseEvent"], context),
1001
+ };
1002
+ }
1003
+ if (event["AudioResponseEvent"] != null) {
1004
+ return {
1005
+ AudioResponseEvent: await deserializeAws_restJson1AudioResponseEvent_event(event["AudioResponseEvent"], context),
1006
+ };
1007
+ }
1008
+ if (event["HeartbeatEvent"] != null) {
1009
+ return {
1010
+ HeartbeatEvent: await deserializeAws_restJson1HeartbeatEvent_event(event["HeartbeatEvent"], context),
1011
+ };
1012
+ }
1013
+ if (event["AccessDeniedException"] != null) {
1014
+ return {
1015
+ AccessDeniedException: await deserializeAws_restJson1AccessDeniedException_event(event["AccessDeniedException"], context),
1016
+ };
1017
+ }
1018
+ if (event["ResourceNotFoundException"] != null) {
1019
+ return {
1020
+ ResourceNotFoundException: await deserializeAws_restJson1ResourceNotFoundException_event(event["ResourceNotFoundException"], context),
1021
+ };
1022
+ }
1023
+ if (event["ValidationException"] != null) {
1024
+ return {
1025
+ ValidationException: await deserializeAws_restJson1ValidationException_event(event["ValidationException"], context),
1026
+ };
1027
+ }
1028
+ if (event["ThrottlingException"] != null) {
1029
+ return {
1030
+ ThrottlingException: await deserializeAws_restJson1ThrottlingException_event(event["ThrottlingException"], context),
1031
+ };
1032
+ }
1033
+ if (event["InternalServerException"] != null) {
1034
+ return {
1035
+ InternalServerException: await deserializeAws_restJson1InternalServerException_event(event["InternalServerException"], context),
1036
+ };
1037
+ }
1038
+ if (event["ConflictException"] != null) {
1039
+ return {
1040
+ ConflictException: await deserializeAws_restJson1ConflictException_event(event["ConflictException"], context),
1041
+ };
1042
+ }
1043
+ if (event["DependencyFailedException"] != null) {
1044
+ return {
1045
+ DependencyFailedException: await deserializeAws_restJson1DependencyFailedException_event(event["DependencyFailedException"], context),
1046
+ };
1047
+ }
1048
+ if (event["BadGatewayException"] != null) {
1049
+ return {
1050
+ BadGatewayException: await deserializeAws_restJson1BadGatewayException_event(event["BadGatewayException"], context),
1051
+ };
1052
+ }
1053
+ return { $unknown: output };
1054
+ });
982
1055
  };
983
1056
  const deserializeAws_restJson1AccessDeniedException_event = async (output, context) => {
984
1057
  const parsedOutput = {
@@ -988,12 +1061,9 @@ const deserializeAws_restJson1AccessDeniedException_event = async (output, conte
988
1061
  return deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
989
1062
  };
990
1063
  const deserializeAws_restJson1AudioResponseEvent_event = async (output, context) => {
991
- let contents = {};
1064
+ const contents = {};
992
1065
  const data = await parseBody(output.body, context);
993
- contents = {
994
- ...contents,
995
- ...deserializeAws_restJson1AudioResponseEvent(data, context),
996
- };
1066
+ Object.assign(contents, deserializeAws_restJson1AudioResponseEvent(data, context));
997
1067
  return contents;
998
1068
  };
999
1069
  const deserializeAws_restJson1BadGatewayException_event = async (output, context) => {
@@ -1018,21 +1088,15 @@ const deserializeAws_restJson1DependencyFailedException_event = async (output, c
1018
1088
  return deserializeAws_restJson1DependencyFailedExceptionResponse(parsedOutput, context);
1019
1089
  };
1020
1090
  const deserializeAws_restJson1HeartbeatEvent_event = async (output, context) => {
1021
- let contents = {};
1091
+ const contents = {};
1022
1092
  const data = await parseBody(output.body, context);
1023
- contents = {
1024
- ...contents,
1025
- ...deserializeAws_restJson1HeartbeatEvent(data, context),
1026
- };
1093
+ Object.assign(contents, deserializeAws_restJson1HeartbeatEvent(data, context));
1027
1094
  return contents;
1028
1095
  };
1029
1096
  const deserializeAws_restJson1IntentResultEvent_event = async (output, context) => {
1030
- let contents = {};
1097
+ const contents = {};
1031
1098
  const data = await parseBody(output.body, context);
1032
- contents = {
1033
- ...contents,
1034
- ...deserializeAws_restJson1IntentResultEvent(data, context),
1035
- };
1099
+ Object.assign(contents, deserializeAws_restJson1IntentResultEvent(data, context));
1036
1100
  return contents;
1037
1101
  };
1038
1102
  const deserializeAws_restJson1InternalServerException_event = async (output, context) => {
@@ -1043,12 +1107,9 @@ const deserializeAws_restJson1InternalServerException_event = async (output, con
1043
1107
  return deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1044
1108
  };
1045
1109
  const deserializeAws_restJson1PlaybackInterruptionEvent_event = async (output, context) => {
1046
- let contents = {};
1110
+ const contents = {};
1047
1111
  const data = await parseBody(output.body, context);
1048
- contents = {
1049
- ...contents,
1050
- ...deserializeAws_restJson1PlaybackInterruptionEvent(data, context),
1051
- };
1112
+ Object.assign(contents, deserializeAws_restJson1PlaybackInterruptionEvent(data, context));
1052
1113
  return contents;
1053
1114
  };
1054
1115
  const deserializeAws_restJson1ResourceNotFoundException_event = async (output, context) => {
@@ -1059,12 +1120,9 @@ const deserializeAws_restJson1ResourceNotFoundException_event = async (output, c
1059
1120
  return deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1060
1121
  };
1061
1122
  const deserializeAws_restJson1TextResponseEvent_event = async (output, context) => {
1062
- let contents = {};
1123
+ const contents = {};
1063
1124
  const data = await parseBody(output.body, context);
1064
- contents = {
1065
- ...contents,
1066
- ...deserializeAws_restJson1TextResponseEvent(data, context),
1067
- };
1125
+ Object.assign(contents, deserializeAws_restJson1TextResponseEvent(data, context));
1068
1126
  return contents;
1069
1127
  };
1070
1128
  const deserializeAws_restJson1ThrottlingException_event = async (output, context) => {
@@ -1075,12 +1133,9 @@ const deserializeAws_restJson1ThrottlingException_event = async (output, context
1075
1133
  return deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1076
1134
  };
1077
1135
  const deserializeAws_restJson1TranscriptEvent_event = async (output, context) => {
1078
- let contents = {};
1136
+ const contents = {};
1079
1137
  const data = await parseBody(output.body, context);
1080
- contents = {
1081
- ...contents,
1082
- ...deserializeAws_restJson1TranscriptEvent(data, context),
1083
- };
1138
+ Object.assign(contents, deserializeAws_restJson1TranscriptEvent(data, context));
1084
1139
  return contents;
1085
1140
  };
1086
1141
  const deserializeAws_restJson1ValidationException_event = async (output, context) => {
@@ -1090,102 +1145,6 @@ const deserializeAws_restJson1ValidationException_event = async (output, context
1090
1145
  };
1091
1146
  return deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1092
1147
  };
1093
- const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
1094
- const contents = {};
1095
- const data = parsedOutput.body;
1096
- if (data.message !== undefined && data.message !== null) {
1097
- contents.message = (0, smithy_client_1.expectString)(data.message);
1098
- }
1099
- const exception = new models_0_1.AccessDeniedException({
1100
- $metadata: deserializeMetadata(parsedOutput),
1101
- ...contents,
1102
- });
1103
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1104
- };
1105
- const deserializeAws_restJson1BadGatewayExceptionResponse = async (parsedOutput, context) => {
1106
- const contents = {};
1107
- const data = parsedOutput.body;
1108
- if (data.message !== undefined && data.message !== null) {
1109
- contents.message = (0, smithy_client_1.expectString)(data.message);
1110
- }
1111
- const exception = new models_0_1.BadGatewayException({
1112
- $metadata: deserializeMetadata(parsedOutput),
1113
- ...contents,
1114
- });
1115
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1116
- };
1117
- const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
1118
- const contents = {};
1119
- const data = parsedOutput.body;
1120
- if (data.message !== undefined && data.message !== null) {
1121
- contents.message = (0, smithy_client_1.expectString)(data.message);
1122
- }
1123
- const exception = new models_0_1.ConflictException({
1124
- $metadata: deserializeMetadata(parsedOutput),
1125
- ...contents,
1126
- });
1127
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1128
- };
1129
- const deserializeAws_restJson1DependencyFailedExceptionResponse = async (parsedOutput, context) => {
1130
- const contents = {};
1131
- const data = parsedOutput.body;
1132
- if (data.message !== undefined && data.message !== null) {
1133
- contents.message = (0, smithy_client_1.expectString)(data.message);
1134
- }
1135
- const exception = new models_0_1.DependencyFailedException({
1136
- $metadata: deserializeMetadata(parsedOutput),
1137
- ...contents,
1138
- });
1139
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1140
- };
1141
- const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
1142
- const contents = {};
1143
- const data = parsedOutput.body;
1144
- if (data.message !== undefined && data.message !== null) {
1145
- contents.message = (0, smithy_client_1.expectString)(data.message);
1146
- }
1147
- const exception = new models_0_1.InternalServerException({
1148
- $metadata: deserializeMetadata(parsedOutput),
1149
- ...contents,
1150
- });
1151
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1152
- };
1153
- const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
1154
- const contents = {};
1155
- const data = parsedOutput.body;
1156
- if (data.message !== undefined && data.message !== null) {
1157
- contents.message = (0, smithy_client_1.expectString)(data.message);
1158
- }
1159
- const exception = new models_0_1.ResourceNotFoundException({
1160
- $metadata: deserializeMetadata(parsedOutput),
1161
- ...contents,
1162
- });
1163
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1164
- };
1165
- const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
1166
- const contents = {};
1167
- const data = parsedOutput.body;
1168
- if (data.message !== undefined && data.message !== null) {
1169
- contents.message = (0, smithy_client_1.expectString)(data.message);
1170
- }
1171
- const exception = new models_0_1.ThrottlingException({
1172
- $metadata: deserializeMetadata(parsedOutput),
1173
- ...contents,
1174
- });
1175
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1176
- };
1177
- const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
1178
- const contents = {};
1179
- const data = parsedOutput.body;
1180
- if (data.message !== undefined && data.message !== null) {
1181
- contents.message = (0, smithy_client_1.expectString)(data.message);
1182
- }
1183
- const exception = new models_0_1.ValidationException({
1184
- $metadata: deserializeMetadata(parsedOutput),
1185
- ...contents,
1186
- });
1187
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1188
- };
1189
1148
  const serializeAws_restJson1ActiveContext = (input, context) => {
1190
1149
  return {
1191
1150
  ...(input.contextAttributes != null && {
@@ -1411,19 +1370,6 @@ const serializeAws_restJson1Slots = (input, context) => {
1411
1370
  };
1412
1371
  }, {});
1413
1372
  };
1414
- const serializeAws_restJson1StartConversationRequestEventStream = (input, context) => {
1415
- return models_0_1.StartConversationRequestEventStream.visit(input, {
1416
- AudioInputEvent: (value) => ({ AudioInputEvent: serializeAws_restJson1AudioInputEvent(value, context) }),
1417
- ConfigurationEvent: (value) => ({ ConfigurationEvent: serializeAws_restJson1ConfigurationEvent(value, context) }),
1418
- DTMFInputEvent: (value) => ({ DTMFInputEvent: serializeAws_restJson1DTMFInputEvent(value, context) }),
1419
- DisconnectionEvent: (value) => ({ DisconnectionEvent: serializeAws_restJson1DisconnectionEvent(value, context) }),
1420
- PlaybackCompletionEvent: (value) => ({
1421
- PlaybackCompletionEvent: serializeAws_restJson1PlaybackCompletionEvent(value, context),
1422
- }),
1423
- TextInputEvent: (value) => ({ TextInputEvent: serializeAws_restJson1TextInputEvent(value, context) }),
1424
- _: (name, value) => ({ name: value }),
1425
- });
1426
- };
1427
1373
  const serializeAws_restJson1StringList = (input, context) => {
1428
1374
  return input
1429
1375
  .filter((e) => e != null)
@@ -1471,11 +1417,6 @@ const serializeAws_restJson1Values = (input, context) => {
1471
1417
  return serializeAws_restJson1Slot(entry, context);
1472
1418
  });
1473
1419
  };
1474
- const deserializeAws_restJson1AccessDeniedException = (output, context) => {
1475
- return {
1476
- message: (0, smithy_client_1.expectString)(output.message),
1477
- };
1478
- };
1479
1420
  const deserializeAws_restJson1ActiveContext = (output, context) => {
1480
1421
  return {
1481
1422
  contextAttributes: output.contextAttributes != null
@@ -1522,11 +1463,6 @@ const deserializeAws_restJson1AudioResponseEvent = (output, context) => {
1522
1463
  eventId: (0, smithy_client_1.expectString)(output.eventId),
1523
1464
  };
1524
1465
  };
1525
- const deserializeAws_restJson1BadGatewayException = (output, context) => {
1526
- return {
1527
- message: (0, smithy_client_1.expectString)(output.message),
1528
- };
1529
- };
1530
1466
  const deserializeAws_restJson1Button = (output, context) => {
1531
1467
  return {
1532
1468
  text: (0, smithy_client_1.expectString)(output.text),
@@ -1549,16 +1485,6 @@ const deserializeAws_restJson1ConfidenceScore = (output, context) => {
1549
1485
  score: (0, smithy_client_1.limitedParseDouble)(output.score),
1550
1486
  };
1551
1487
  };
1552
- const deserializeAws_restJson1ConflictException = (output, context) => {
1553
- return {
1554
- message: (0, smithy_client_1.expectString)(output.message),
1555
- };
1556
- };
1557
- const deserializeAws_restJson1DependencyFailedException = (output, context) => {
1558
- return {
1559
- message: (0, smithy_client_1.expectString)(output.message),
1560
- };
1561
- };
1562
1488
  const deserializeAws_restJson1DialogAction = (output, context) => {
1563
1489
  return {
1564
1490
  slotElicitationStyle: (0, smithy_client_1.expectString)(output.slotElicitationStyle),
@@ -1601,11 +1527,6 @@ const deserializeAws_restJson1IntentResultEvent = (output, context) => {
1601
1527
  sessionState: output.sessionState != null ? deserializeAws_restJson1SessionState(output.sessionState, context) : undefined,
1602
1528
  };
1603
1529
  };
1604
- const deserializeAws_restJson1InternalServerException = (output, context) => {
1605
- return {
1606
- message: (0, smithy_client_1.expectString)(output.message),
1607
- };
1608
- };
1609
1530
  const deserializeAws_restJson1Interpretation = (output, context) => {
1610
1531
  return {
1611
1532
  intent: output.intent != null ? deserializeAws_restJson1Intent(output.intent, context) : undefined,
@@ -1653,11 +1574,6 @@ const deserializeAws_restJson1PlaybackInterruptionEvent = (output, context) => {
1653
1574
  eventReason: (0, smithy_client_1.expectString)(output.eventReason),
1654
1575
  };
1655
1576
  };
1656
- const deserializeAws_restJson1ResourceNotFoundException = (output, context) => {
1657
- return {
1658
- message: (0, smithy_client_1.expectString)(output.message),
1659
- };
1660
- };
1661
1577
  const deserializeAws_restJson1RuntimeHintDetails = (output, context) => {
1662
1578
  return {
1663
1579
  runtimeHintValues: output.runtimeHintValues != null
@@ -1756,79 +1672,6 @@ const deserializeAws_restJson1Slots = (output, context) => {
1756
1672
  };
1757
1673
  }, {});
1758
1674
  };
1759
- const deserializeAws_restJson1StartConversationResponseEventStream = (output, context) => {
1760
- if (output.AccessDeniedException !== undefined && output.AccessDeniedException !== null) {
1761
- return {
1762
- AccessDeniedException: deserializeAws_restJson1AccessDeniedException(output.AccessDeniedException, context),
1763
- };
1764
- }
1765
- if (output.AudioResponseEvent !== undefined && output.AudioResponseEvent !== null) {
1766
- return {
1767
- AudioResponseEvent: deserializeAws_restJson1AudioResponseEvent(output.AudioResponseEvent, context),
1768
- };
1769
- }
1770
- if (output.BadGatewayException !== undefined && output.BadGatewayException !== null) {
1771
- return {
1772
- BadGatewayException: deserializeAws_restJson1BadGatewayException(output.BadGatewayException, context),
1773
- };
1774
- }
1775
- if (output.ConflictException !== undefined && output.ConflictException !== null) {
1776
- return {
1777
- ConflictException: deserializeAws_restJson1ConflictException(output.ConflictException, context),
1778
- };
1779
- }
1780
- if (output.DependencyFailedException !== undefined && output.DependencyFailedException !== null) {
1781
- return {
1782
- DependencyFailedException: deserializeAws_restJson1DependencyFailedException(output.DependencyFailedException, context),
1783
- };
1784
- }
1785
- if (output.HeartbeatEvent !== undefined && output.HeartbeatEvent !== null) {
1786
- return {
1787
- HeartbeatEvent: deserializeAws_restJson1HeartbeatEvent(output.HeartbeatEvent, context),
1788
- };
1789
- }
1790
- if (output.IntentResultEvent !== undefined && output.IntentResultEvent !== null) {
1791
- return {
1792
- IntentResultEvent: deserializeAws_restJson1IntentResultEvent(output.IntentResultEvent, context),
1793
- };
1794
- }
1795
- if (output.InternalServerException !== undefined && output.InternalServerException !== null) {
1796
- return {
1797
- InternalServerException: deserializeAws_restJson1InternalServerException(output.InternalServerException, context),
1798
- };
1799
- }
1800
- if (output.PlaybackInterruptionEvent !== undefined && output.PlaybackInterruptionEvent !== null) {
1801
- return {
1802
- PlaybackInterruptionEvent: deserializeAws_restJson1PlaybackInterruptionEvent(output.PlaybackInterruptionEvent, context),
1803
- };
1804
- }
1805
- if (output.ResourceNotFoundException !== undefined && output.ResourceNotFoundException !== null) {
1806
- return {
1807
- ResourceNotFoundException: deserializeAws_restJson1ResourceNotFoundException(output.ResourceNotFoundException, context),
1808
- };
1809
- }
1810
- if (output.TextResponseEvent !== undefined && output.TextResponseEvent !== null) {
1811
- return {
1812
- TextResponseEvent: deserializeAws_restJson1TextResponseEvent(output.TextResponseEvent, context),
1813
- };
1814
- }
1815
- if (output.ThrottlingException !== undefined && output.ThrottlingException !== null) {
1816
- return {
1817
- ThrottlingException: deserializeAws_restJson1ThrottlingException(output.ThrottlingException, context),
1818
- };
1819
- }
1820
- if (output.TranscriptEvent !== undefined && output.TranscriptEvent !== null) {
1821
- return {
1822
- TranscriptEvent: deserializeAws_restJson1TranscriptEvent(output.TranscriptEvent, context),
1823
- };
1824
- }
1825
- if (output.ValidationException !== undefined && output.ValidationException !== null) {
1826
- return {
1827
- ValidationException: deserializeAws_restJson1ValidationException(output.ValidationException, context),
1828
- };
1829
- }
1830
- return { $unknown: Object.entries(output)[0] };
1831
- };
1832
1675
  const deserializeAws_restJson1StringList = (output, context) => {
1833
1676
  const retVal = (output || [])
1834
1677
  .filter((e) => e != null)
@@ -1857,22 +1700,12 @@ const deserializeAws_restJson1TextResponseEvent = (output, context) => {
1857
1700
  messages: output.messages != null ? deserializeAws_restJson1Messages(output.messages, context) : undefined,
1858
1701
  };
1859
1702
  };
1860
- const deserializeAws_restJson1ThrottlingException = (output, context) => {
1861
- return {
1862
- message: (0, smithy_client_1.expectString)(output.message),
1863
- };
1864
- };
1865
1703
  const deserializeAws_restJson1TranscriptEvent = (output, context) => {
1866
1704
  return {
1867
1705
  eventId: (0, smithy_client_1.expectString)(output.eventId),
1868
1706
  transcript: (0, smithy_client_1.expectString)(output.transcript),
1869
1707
  };
1870
1708
  };
1871
- const deserializeAws_restJson1ValidationException = (output, context) => {
1872
- return {
1873
- message: (0, smithy_client_1.expectString)(output.message),
1874
- };
1875
- };
1876
1709
  const deserializeAws_restJson1Value = (output, context) => {
1877
1710
  return {
1878
1711
  interpretedValue: (0, smithy_client_1.expectString)(output.interpretedValue),