@aws-sdk/client-lex-runtime-v2 3.504.0 → 3.509.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.
package/dist-cjs/index.js CHANGED
@@ -666,7 +666,7 @@ var se_StartConversationCommand = /* @__PURE__ */ __name(async (input, context)
666
666
  }, "se_StartConversationCommand");
667
667
  var de_DeleteSessionCommand = /* @__PURE__ */ __name(async (output, context) => {
668
668
  if (output.statusCode !== 200 && output.statusCode >= 300) {
669
- return de_DeleteSessionCommandError(output, context);
669
+ return de_CommandError(output, context);
670
670
  }
671
671
  const contents = (0, import_smithy_client.map)({
672
672
  $metadata: deserializeMetadata(output)
@@ -681,43 +681,9 @@ var de_DeleteSessionCommand = /* @__PURE__ */ __name(async (output, context) =>
681
681
  Object.assign(contents, doc);
682
682
  return contents;
683
683
  }, "de_DeleteSessionCommand");
684
- var de_DeleteSessionCommandError = /* @__PURE__ */ __name(async (output, context) => {
685
- const parsedOutput = {
686
- ...output,
687
- body: await parseErrorBody(output.body, context)
688
- };
689
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
690
- switch (errorCode) {
691
- case "AccessDeniedException":
692
- case "com.amazonaws.lexruntimev2#AccessDeniedException":
693
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
694
- case "ConflictException":
695
- case "com.amazonaws.lexruntimev2#ConflictException":
696
- throw await de_ConflictExceptionRes(parsedOutput, context);
697
- case "InternalServerException":
698
- case "com.amazonaws.lexruntimev2#InternalServerException":
699
- throw await de_InternalServerExceptionRes(parsedOutput, context);
700
- case "ResourceNotFoundException":
701
- case "com.amazonaws.lexruntimev2#ResourceNotFoundException":
702
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
703
- case "ThrottlingException":
704
- case "com.amazonaws.lexruntimev2#ThrottlingException":
705
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
706
- case "ValidationException":
707
- case "com.amazonaws.lexruntimev2#ValidationException":
708
- throw await de_ValidationExceptionRes(parsedOutput, context);
709
- default:
710
- const parsedBody = parsedOutput.body;
711
- return throwDefaultError({
712
- output,
713
- parsedBody,
714
- errorCode
715
- });
716
- }
717
- }, "de_DeleteSessionCommandError");
718
684
  var de_GetSessionCommand = /* @__PURE__ */ __name(async (output, context) => {
719
685
  if (output.statusCode !== 200 && output.statusCode >= 300) {
720
- return de_GetSessionCommandError(output, context);
686
+ return de_CommandError(output, context);
721
687
  }
722
688
  const contents = (0, import_smithy_client.map)({
723
689
  $metadata: deserializeMetadata(output)
@@ -732,40 +698,9 @@ var de_GetSessionCommand = /* @__PURE__ */ __name(async (output, context) => {
732
698
  Object.assign(contents, doc);
733
699
  return contents;
734
700
  }, "de_GetSessionCommand");
735
- var de_GetSessionCommandError = /* @__PURE__ */ __name(async (output, context) => {
736
- const parsedOutput = {
737
- ...output,
738
- body: await parseErrorBody(output.body, context)
739
- };
740
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
741
- switch (errorCode) {
742
- case "AccessDeniedException":
743
- case "com.amazonaws.lexruntimev2#AccessDeniedException":
744
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
745
- case "InternalServerException":
746
- case "com.amazonaws.lexruntimev2#InternalServerException":
747
- throw await de_InternalServerExceptionRes(parsedOutput, context);
748
- case "ResourceNotFoundException":
749
- case "com.amazonaws.lexruntimev2#ResourceNotFoundException":
750
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
751
- case "ThrottlingException":
752
- case "com.amazonaws.lexruntimev2#ThrottlingException":
753
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
754
- case "ValidationException":
755
- case "com.amazonaws.lexruntimev2#ValidationException":
756
- throw await de_ValidationExceptionRes(parsedOutput, context);
757
- default:
758
- const parsedBody = parsedOutput.body;
759
- return throwDefaultError({
760
- output,
761
- parsedBody,
762
- errorCode
763
- });
764
- }
765
- }, "de_GetSessionCommandError");
766
701
  var de_PutSessionCommand = /* @__PURE__ */ __name(async (output, context) => {
767
702
  if (output.statusCode !== 200 && output.statusCode >= 300) {
768
- return de_PutSessionCommandError(output, context);
703
+ return de_CommandError(output, context);
769
704
  }
770
705
  const contents = (0, import_smithy_client.map)({
771
706
  $metadata: deserializeMetadata(output),
@@ -780,49 +715,9 @@ var de_PutSessionCommand = /* @__PURE__ */ __name(async (output, context) => {
780
715
  contents.audioStream = data;
781
716
  return contents;
782
717
  }, "de_PutSessionCommand");
783
- var de_PutSessionCommandError = /* @__PURE__ */ __name(async (output, context) => {
784
- const parsedOutput = {
785
- ...output,
786
- body: await parseErrorBody(output.body, context)
787
- };
788
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
789
- switch (errorCode) {
790
- case "AccessDeniedException":
791
- case "com.amazonaws.lexruntimev2#AccessDeniedException":
792
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
793
- case "BadGatewayException":
794
- case "com.amazonaws.lexruntimev2#BadGatewayException":
795
- throw await de_BadGatewayExceptionRes(parsedOutput, context);
796
- case "ConflictException":
797
- case "com.amazonaws.lexruntimev2#ConflictException":
798
- throw await de_ConflictExceptionRes(parsedOutput, context);
799
- case "DependencyFailedException":
800
- case "com.amazonaws.lexruntimev2#DependencyFailedException":
801
- throw await de_DependencyFailedExceptionRes(parsedOutput, context);
802
- case "InternalServerException":
803
- case "com.amazonaws.lexruntimev2#InternalServerException":
804
- throw await de_InternalServerExceptionRes(parsedOutput, context);
805
- case "ResourceNotFoundException":
806
- case "com.amazonaws.lexruntimev2#ResourceNotFoundException":
807
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
808
- case "ThrottlingException":
809
- case "com.amazonaws.lexruntimev2#ThrottlingException":
810
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
811
- case "ValidationException":
812
- case "com.amazonaws.lexruntimev2#ValidationException":
813
- throw await de_ValidationExceptionRes(parsedOutput, context);
814
- default:
815
- const parsedBody = parsedOutput.body;
816
- return throwDefaultError({
817
- output,
818
- parsedBody,
819
- errorCode
820
- });
821
- }
822
- }, "de_PutSessionCommandError");
823
718
  var de_RecognizeTextCommand = /* @__PURE__ */ __name(async (output, context) => {
824
719
  if (output.statusCode !== 200 && output.statusCode >= 300) {
825
- return de_RecognizeTextCommandError(output, context);
720
+ return de_CommandError(output, context);
826
721
  }
827
722
  const contents = (0, import_smithy_client.map)({
828
723
  $metadata: deserializeMetadata(output)
@@ -839,49 +734,9 @@ var de_RecognizeTextCommand = /* @__PURE__ */ __name(async (output, context) =>
839
734
  Object.assign(contents, doc);
840
735
  return contents;
841
736
  }, "de_RecognizeTextCommand");
842
- var de_RecognizeTextCommandError = /* @__PURE__ */ __name(async (output, context) => {
843
- const parsedOutput = {
844
- ...output,
845
- body: await parseErrorBody(output.body, context)
846
- };
847
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
848
- switch (errorCode) {
849
- case "AccessDeniedException":
850
- case "com.amazonaws.lexruntimev2#AccessDeniedException":
851
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
852
- case "BadGatewayException":
853
- case "com.amazonaws.lexruntimev2#BadGatewayException":
854
- throw await de_BadGatewayExceptionRes(parsedOutput, context);
855
- case "ConflictException":
856
- case "com.amazonaws.lexruntimev2#ConflictException":
857
- throw await de_ConflictExceptionRes(parsedOutput, context);
858
- case "DependencyFailedException":
859
- case "com.amazonaws.lexruntimev2#DependencyFailedException":
860
- throw await de_DependencyFailedExceptionRes(parsedOutput, context);
861
- case "InternalServerException":
862
- case "com.amazonaws.lexruntimev2#InternalServerException":
863
- throw await de_InternalServerExceptionRes(parsedOutput, context);
864
- case "ResourceNotFoundException":
865
- case "com.amazonaws.lexruntimev2#ResourceNotFoundException":
866
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
867
- case "ThrottlingException":
868
- case "com.amazonaws.lexruntimev2#ThrottlingException":
869
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
870
- case "ValidationException":
871
- case "com.amazonaws.lexruntimev2#ValidationException":
872
- throw await de_ValidationExceptionRes(parsedOutput, context);
873
- default:
874
- const parsedBody = parsedOutput.body;
875
- return throwDefaultError({
876
- output,
877
- parsedBody,
878
- errorCode
879
- });
880
- }
881
- }, "de_RecognizeTextCommandError");
882
737
  var de_RecognizeUtteranceCommand = /* @__PURE__ */ __name(async (output, context) => {
883
738
  if (output.statusCode !== 200 && output.statusCode >= 300) {
884
- return de_RecognizeUtteranceCommandError(output, context);
739
+ return de_CommandError(output, context);
885
740
  }
886
741
  const contents = (0, import_smithy_client.map)({
887
742
  $metadata: deserializeMetadata(output),
@@ -900,49 +755,9 @@ var de_RecognizeUtteranceCommand = /* @__PURE__ */ __name(async (output, context
900
755
  contents.audioStream = data;
901
756
  return contents;
902
757
  }, "de_RecognizeUtteranceCommand");
903
- var de_RecognizeUtteranceCommandError = /* @__PURE__ */ __name(async (output, context) => {
904
- const parsedOutput = {
905
- ...output,
906
- body: await parseErrorBody(output.body, context)
907
- };
908
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
909
- switch (errorCode) {
910
- case "AccessDeniedException":
911
- case "com.amazonaws.lexruntimev2#AccessDeniedException":
912
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
913
- case "BadGatewayException":
914
- case "com.amazonaws.lexruntimev2#BadGatewayException":
915
- throw await de_BadGatewayExceptionRes(parsedOutput, context);
916
- case "ConflictException":
917
- case "com.amazonaws.lexruntimev2#ConflictException":
918
- throw await de_ConflictExceptionRes(parsedOutput, context);
919
- case "DependencyFailedException":
920
- case "com.amazonaws.lexruntimev2#DependencyFailedException":
921
- throw await de_DependencyFailedExceptionRes(parsedOutput, context);
922
- case "InternalServerException":
923
- case "com.amazonaws.lexruntimev2#InternalServerException":
924
- throw await de_InternalServerExceptionRes(parsedOutput, context);
925
- case "ResourceNotFoundException":
926
- case "com.amazonaws.lexruntimev2#ResourceNotFoundException":
927
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
928
- case "ThrottlingException":
929
- case "com.amazonaws.lexruntimev2#ThrottlingException":
930
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
931
- case "ValidationException":
932
- case "com.amazonaws.lexruntimev2#ValidationException":
933
- throw await de_ValidationExceptionRes(parsedOutput, context);
934
- default:
935
- const parsedBody = parsedOutput.body;
936
- return throwDefaultError({
937
- output,
938
- parsedBody,
939
- errorCode
940
- });
941
- }
942
- }, "de_RecognizeUtteranceCommandError");
943
758
  var de_StartConversationCommand = /* @__PURE__ */ __name(async (output, context) => {
944
759
  if (output.statusCode !== 200 && output.statusCode >= 300) {
945
- return de_StartConversationCommandError(output, context);
760
+ return de_CommandError(output, context);
946
761
  }
947
762
  const contents = (0, import_smithy_client.map)({
948
763
  $metadata: deserializeMetadata(output)
@@ -951,7 +766,7 @@ var de_StartConversationCommand = /* @__PURE__ */ __name(async (output, context)
951
766
  contents.responseEventStream = de_StartConversationResponseEventStream(data, context);
952
767
  return contents;
953
768
  }, "de_StartConversationCommand");
954
- var de_StartConversationCommandError = /* @__PURE__ */ __name(async (output, context) => {
769
+ var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
955
770
  const parsedOutput = {
956
771
  ...output,
957
772
  body: await parseErrorBody(output.body, context)
@@ -961,15 +776,27 @@ var de_StartConversationCommandError = /* @__PURE__ */ __name(async (output, con
961
776
  case "AccessDeniedException":
962
777
  case "com.amazonaws.lexruntimev2#AccessDeniedException":
963
778
  throw await de_AccessDeniedExceptionRes(parsedOutput, context);
779
+ case "ConflictException":
780
+ case "com.amazonaws.lexruntimev2#ConflictException":
781
+ throw await de_ConflictExceptionRes(parsedOutput, context);
964
782
  case "InternalServerException":
965
783
  case "com.amazonaws.lexruntimev2#InternalServerException":
966
784
  throw await de_InternalServerExceptionRes(parsedOutput, context);
785
+ case "ResourceNotFoundException":
786
+ case "com.amazonaws.lexruntimev2#ResourceNotFoundException":
787
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
967
788
  case "ThrottlingException":
968
789
  case "com.amazonaws.lexruntimev2#ThrottlingException":
969
790
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
970
791
  case "ValidationException":
971
792
  case "com.amazonaws.lexruntimev2#ValidationException":
972
793
  throw await de_ValidationExceptionRes(parsedOutput, context);
794
+ case "BadGatewayException":
795
+ case "com.amazonaws.lexruntimev2#BadGatewayException":
796
+ throw await de_BadGatewayExceptionRes(parsedOutput, context);
797
+ case "DependencyFailedException":
798
+ case "com.amazonaws.lexruntimev2#DependencyFailedException":
799
+ throw await de_DependencyFailedExceptionRes(parsedOutput, context);
973
800
  default:
974
801
  const parsedBody = parsedOutput.body;
975
802
  return throwDefaultError({
@@ -978,7 +805,7 @@ var de_StartConversationCommandError = /* @__PURE__ */ __name(async (output, con
978
805
  errorCode
979
806
  });
980
807
  }
981
- }, "de_StartConversationCommandError");
808
+ }, "de_CommandError");
982
809
  var throwDefaultError = (0, import_smithy_client.withBaseException)(LexRuntimeV2ServiceException);
983
810
  var de_AccessDeniedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
984
811
  const contents = (0, import_smithy_client.map)({});
@@ -105,7 +105,7 @@ export const se_StartConversationCommand = async (input, context) => {
105
105
  };
106
106
  export const de_DeleteSessionCommand = async (output, context) => {
107
107
  if (output.statusCode !== 200 && output.statusCode >= 300) {
108
- return de_DeleteSessionCommandError(output, context);
108
+ return de_CommandError(output, context);
109
109
  }
110
110
  const contents = map({
111
111
  $metadata: deserializeMetadata(output),
@@ -120,43 +120,9 @@ export const de_DeleteSessionCommand = async (output, context) => {
120
120
  Object.assign(contents, doc);
121
121
  return contents;
122
122
  };
123
- const de_DeleteSessionCommandError = async (output, context) => {
124
- const parsedOutput = {
125
- ...output,
126
- body: await parseErrorBody(output.body, context),
127
- };
128
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
129
- switch (errorCode) {
130
- case "AccessDeniedException":
131
- case "com.amazonaws.lexruntimev2#AccessDeniedException":
132
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
133
- case "ConflictException":
134
- case "com.amazonaws.lexruntimev2#ConflictException":
135
- throw await de_ConflictExceptionRes(parsedOutput, context);
136
- case "InternalServerException":
137
- case "com.amazonaws.lexruntimev2#InternalServerException":
138
- throw await de_InternalServerExceptionRes(parsedOutput, context);
139
- case "ResourceNotFoundException":
140
- case "com.amazonaws.lexruntimev2#ResourceNotFoundException":
141
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
142
- case "ThrottlingException":
143
- case "com.amazonaws.lexruntimev2#ThrottlingException":
144
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
145
- case "ValidationException":
146
- case "com.amazonaws.lexruntimev2#ValidationException":
147
- throw await de_ValidationExceptionRes(parsedOutput, context);
148
- default:
149
- const parsedBody = parsedOutput.body;
150
- return throwDefaultError({
151
- output,
152
- parsedBody,
153
- errorCode,
154
- });
155
- }
156
- };
157
123
  export const de_GetSessionCommand = async (output, context) => {
158
124
  if (output.statusCode !== 200 && output.statusCode >= 300) {
159
- return de_GetSessionCommandError(output, context);
125
+ return de_CommandError(output, context);
160
126
  }
161
127
  const contents = map({
162
128
  $metadata: deserializeMetadata(output),
@@ -171,40 +137,9 @@ export const de_GetSessionCommand = async (output, context) => {
171
137
  Object.assign(contents, doc);
172
138
  return contents;
173
139
  };
174
- const de_GetSessionCommandError = async (output, context) => {
175
- const parsedOutput = {
176
- ...output,
177
- body: await parseErrorBody(output.body, context),
178
- };
179
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
180
- switch (errorCode) {
181
- case "AccessDeniedException":
182
- case "com.amazonaws.lexruntimev2#AccessDeniedException":
183
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
184
- case "InternalServerException":
185
- case "com.amazonaws.lexruntimev2#InternalServerException":
186
- throw await de_InternalServerExceptionRes(parsedOutput, context);
187
- case "ResourceNotFoundException":
188
- case "com.amazonaws.lexruntimev2#ResourceNotFoundException":
189
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
190
- case "ThrottlingException":
191
- case "com.amazonaws.lexruntimev2#ThrottlingException":
192
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
193
- case "ValidationException":
194
- case "com.amazonaws.lexruntimev2#ValidationException":
195
- throw await de_ValidationExceptionRes(parsedOutput, context);
196
- default:
197
- const parsedBody = parsedOutput.body;
198
- return throwDefaultError({
199
- output,
200
- parsedBody,
201
- errorCode,
202
- });
203
- }
204
- };
205
140
  export const de_PutSessionCommand = async (output, context) => {
206
141
  if (output.statusCode !== 200 && output.statusCode >= 300) {
207
- return de_PutSessionCommandError(output, context);
142
+ return de_CommandError(output, context);
208
143
  }
209
144
  const contents = map({
210
145
  $metadata: deserializeMetadata(output),
@@ -219,49 +154,9 @@ export const de_PutSessionCommand = async (output, context) => {
219
154
  contents.audioStream = data;
220
155
  return contents;
221
156
  };
222
- const de_PutSessionCommandError = async (output, context) => {
223
- const parsedOutput = {
224
- ...output,
225
- body: await parseErrorBody(output.body, context),
226
- };
227
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
228
- switch (errorCode) {
229
- case "AccessDeniedException":
230
- case "com.amazonaws.lexruntimev2#AccessDeniedException":
231
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
232
- case "BadGatewayException":
233
- case "com.amazonaws.lexruntimev2#BadGatewayException":
234
- throw await de_BadGatewayExceptionRes(parsedOutput, context);
235
- case "ConflictException":
236
- case "com.amazonaws.lexruntimev2#ConflictException":
237
- throw await de_ConflictExceptionRes(parsedOutput, context);
238
- case "DependencyFailedException":
239
- case "com.amazonaws.lexruntimev2#DependencyFailedException":
240
- throw await de_DependencyFailedExceptionRes(parsedOutput, context);
241
- case "InternalServerException":
242
- case "com.amazonaws.lexruntimev2#InternalServerException":
243
- throw await de_InternalServerExceptionRes(parsedOutput, context);
244
- case "ResourceNotFoundException":
245
- case "com.amazonaws.lexruntimev2#ResourceNotFoundException":
246
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
247
- case "ThrottlingException":
248
- case "com.amazonaws.lexruntimev2#ThrottlingException":
249
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
250
- case "ValidationException":
251
- case "com.amazonaws.lexruntimev2#ValidationException":
252
- throw await de_ValidationExceptionRes(parsedOutput, context);
253
- default:
254
- const parsedBody = parsedOutput.body;
255
- return throwDefaultError({
256
- output,
257
- parsedBody,
258
- errorCode,
259
- });
260
- }
261
- };
262
157
  export const de_RecognizeTextCommand = async (output, context) => {
263
158
  if (output.statusCode !== 200 && output.statusCode >= 300) {
264
- return de_RecognizeTextCommandError(output, context);
159
+ return de_CommandError(output, context);
265
160
  }
266
161
  const contents = map({
267
162
  $metadata: deserializeMetadata(output),
@@ -278,49 +173,9 @@ export const de_RecognizeTextCommand = async (output, context) => {
278
173
  Object.assign(contents, doc);
279
174
  return contents;
280
175
  };
281
- const de_RecognizeTextCommandError = async (output, context) => {
282
- const parsedOutput = {
283
- ...output,
284
- body: await parseErrorBody(output.body, context),
285
- };
286
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
287
- switch (errorCode) {
288
- case "AccessDeniedException":
289
- case "com.amazonaws.lexruntimev2#AccessDeniedException":
290
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
291
- case "BadGatewayException":
292
- case "com.amazonaws.lexruntimev2#BadGatewayException":
293
- throw await de_BadGatewayExceptionRes(parsedOutput, context);
294
- case "ConflictException":
295
- case "com.amazonaws.lexruntimev2#ConflictException":
296
- throw await de_ConflictExceptionRes(parsedOutput, context);
297
- case "DependencyFailedException":
298
- case "com.amazonaws.lexruntimev2#DependencyFailedException":
299
- throw await de_DependencyFailedExceptionRes(parsedOutput, context);
300
- case "InternalServerException":
301
- case "com.amazonaws.lexruntimev2#InternalServerException":
302
- throw await de_InternalServerExceptionRes(parsedOutput, context);
303
- case "ResourceNotFoundException":
304
- case "com.amazonaws.lexruntimev2#ResourceNotFoundException":
305
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
306
- case "ThrottlingException":
307
- case "com.amazonaws.lexruntimev2#ThrottlingException":
308
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
309
- case "ValidationException":
310
- case "com.amazonaws.lexruntimev2#ValidationException":
311
- throw await de_ValidationExceptionRes(parsedOutput, context);
312
- default:
313
- const parsedBody = parsedOutput.body;
314
- return throwDefaultError({
315
- output,
316
- parsedBody,
317
- errorCode,
318
- });
319
- }
320
- };
321
176
  export const de_RecognizeUtteranceCommand = async (output, context) => {
322
177
  if (output.statusCode !== 200 && output.statusCode >= 300) {
323
- return de_RecognizeUtteranceCommandError(output, context);
178
+ return de_CommandError(output, context);
324
179
  }
325
180
  const contents = map({
326
181
  $metadata: deserializeMetadata(output),
@@ -339,49 +194,9 @@ export const de_RecognizeUtteranceCommand = async (output, context) => {
339
194
  contents.audioStream = data;
340
195
  return contents;
341
196
  };
342
- const de_RecognizeUtteranceCommandError = async (output, context) => {
343
- const parsedOutput = {
344
- ...output,
345
- body: await parseErrorBody(output.body, context),
346
- };
347
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
348
- switch (errorCode) {
349
- case "AccessDeniedException":
350
- case "com.amazonaws.lexruntimev2#AccessDeniedException":
351
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
352
- case "BadGatewayException":
353
- case "com.amazonaws.lexruntimev2#BadGatewayException":
354
- throw await de_BadGatewayExceptionRes(parsedOutput, context);
355
- case "ConflictException":
356
- case "com.amazonaws.lexruntimev2#ConflictException":
357
- throw await de_ConflictExceptionRes(parsedOutput, context);
358
- case "DependencyFailedException":
359
- case "com.amazonaws.lexruntimev2#DependencyFailedException":
360
- throw await de_DependencyFailedExceptionRes(parsedOutput, context);
361
- case "InternalServerException":
362
- case "com.amazonaws.lexruntimev2#InternalServerException":
363
- throw await de_InternalServerExceptionRes(parsedOutput, context);
364
- case "ResourceNotFoundException":
365
- case "com.amazonaws.lexruntimev2#ResourceNotFoundException":
366
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
367
- case "ThrottlingException":
368
- case "com.amazonaws.lexruntimev2#ThrottlingException":
369
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
370
- case "ValidationException":
371
- case "com.amazonaws.lexruntimev2#ValidationException":
372
- throw await de_ValidationExceptionRes(parsedOutput, context);
373
- default:
374
- const parsedBody = parsedOutput.body;
375
- return throwDefaultError({
376
- output,
377
- parsedBody,
378
- errorCode,
379
- });
380
- }
381
- };
382
197
  export const de_StartConversationCommand = async (output, context) => {
383
198
  if (output.statusCode !== 200 && output.statusCode >= 300) {
384
- return de_StartConversationCommandError(output, context);
199
+ return de_CommandError(output, context);
385
200
  }
386
201
  const contents = map({
387
202
  $metadata: deserializeMetadata(output),
@@ -390,7 +205,7 @@ export const de_StartConversationCommand = async (output, context) => {
390
205
  contents.responseEventStream = de_StartConversationResponseEventStream(data, context);
391
206
  return contents;
392
207
  };
393
- const de_StartConversationCommandError = async (output, context) => {
208
+ const de_CommandError = async (output, context) => {
394
209
  const parsedOutput = {
395
210
  ...output,
396
211
  body: await parseErrorBody(output.body, context),
@@ -400,15 +215,27 @@ const de_StartConversationCommandError = async (output, context) => {
400
215
  case "AccessDeniedException":
401
216
  case "com.amazonaws.lexruntimev2#AccessDeniedException":
402
217
  throw await de_AccessDeniedExceptionRes(parsedOutput, context);
218
+ case "ConflictException":
219
+ case "com.amazonaws.lexruntimev2#ConflictException":
220
+ throw await de_ConflictExceptionRes(parsedOutput, context);
403
221
  case "InternalServerException":
404
222
  case "com.amazonaws.lexruntimev2#InternalServerException":
405
223
  throw await de_InternalServerExceptionRes(parsedOutput, context);
224
+ case "ResourceNotFoundException":
225
+ case "com.amazonaws.lexruntimev2#ResourceNotFoundException":
226
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
406
227
  case "ThrottlingException":
407
228
  case "com.amazonaws.lexruntimev2#ThrottlingException":
408
229
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
409
230
  case "ValidationException":
410
231
  case "com.amazonaws.lexruntimev2#ValidationException":
411
232
  throw await de_ValidationExceptionRes(parsedOutput, context);
233
+ case "BadGatewayException":
234
+ case "com.amazonaws.lexruntimev2#BadGatewayException":
235
+ throw await de_BadGatewayExceptionRes(parsedOutput, context);
236
+ case "DependencyFailedException":
237
+ case "com.amazonaws.lexruntimev2#DependencyFailedException":
238
+ throw await de_DependencyFailedExceptionRes(parsedOutput, context);
412
239
  default:
413
240
  const parsedBody = parsedOutput.body;
414
241
  return throwDefaultError({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-lex-runtime-v2",
3
3
  "description": "AWS SDK for JavaScript Lex Runtime V2 Client for Node.js, Browser and React Native",
4
- "version": "3.504.0",
4
+ "version": "3.509.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "node ../../scripts/compilation/inline client-lex-runtime-v2",
@@ -20,9 +20,9 @@
20
20
  "dependencies": {
21
21
  "@aws-crypto/sha256-browser": "3.0.0",
22
22
  "@aws-crypto/sha256-js": "3.0.0",
23
- "@aws-sdk/client-sts": "3.504.0",
23
+ "@aws-sdk/client-sts": "3.507.0",
24
24
  "@aws-sdk/core": "3.496.0",
25
- "@aws-sdk/credential-provider-node": "3.504.0",
25
+ "@aws-sdk/credential-provider-node": "3.509.0",
26
26
  "@aws-sdk/eventstream-handler-node": "3.502.0",
27
27
  "@aws-sdk/middleware-eventstream": "3.502.0",
28
28
  "@aws-sdk/middleware-host-header": "3.502.0",