@aws-sdk/client-lex-runtime-v2 3.303.0 → 3.309.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/commands/DeleteSessionCommand.js +2 -2
- package/dist-cjs/commands/GetSessionCommand.js +2 -2
- package/dist-cjs/commands/PutSessionCommand.js +2 -2
- package/dist-cjs/commands/RecognizeTextCommand.js +2 -2
- package/dist-cjs/commands/RecognizeUtteranceCommand.js +2 -2
- package/dist-cjs/commands/StartConversationCommand.js +2 -2
- package/dist-cjs/protocols/Aws_restJson1.js +296 -354
- package/dist-es/commands/DeleteSessionCommand.js +3 -3
- package/dist-es/commands/GetSessionCommand.js +3 -3
- package/dist-es/commands/PutSessionCommand.js +3 -3
- package/dist-es/commands/RecognizeTextCommand.js +3 -3
- package/dist-es/commands/RecognizeUtteranceCommand.js +3 -3
- package/dist-es/commands/StartConversationCommand.js +3 -3
- package/dist-es/protocols/Aws_restJson1.js +283 -341
- package/dist-types/protocols/Aws_restJson1.d.ts +48 -12
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +12 -12
- package/package.json +36 -36
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.de_StartConversationCommand = exports.de_RecognizeUtteranceCommand = exports.de_RecognizeTextCommand = exports.de_PutSessionCommand = exports.de_GetSessionCommand = exports.de_DeleteSessionCommand = exports.se_StartConversationCommand = exports.se_RecognizeUtteranceCommand = exports.se_RecognizeTextCommand = exports.se_PutSessionCommand = exports.se_GetSessionCommand = exports.se_DeleteSessionCommand = void 0;
|
|
4
4
|
const protocol_http_1 = require("@aws-sdk/protocol-http");
|
|
5
5
|
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
6
6
|
const LexRuntimeV2ServiceException_1 = require("../models/LexRuntimeV2ServiceException");
|
|
7
7
|
const models_0_1 = require("../models/models_0");
|
|
8
|
-
const
|
|
8
|
+
const se_DeleteSessionCommand = async (input, context) => {
|
|
9
9
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
10
10
|
const headers = {};
|
|
11
11
|
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
@@ -25,8 +25,8 @@ const serializeAws_restJson1DeleteSessionCommand = async (input, context) => {
|
|
|
25
25
|
body,
|
|
26
26
|
});
|
|
27
27
|
};
|
|
28
|
-
exports.
|
|
29
|
-
const
|
|
28
|
+
exports.se_DeleteSessionCommand = se_DeleteSessionCommand;
|
|
29
|
+
const se_GetSessionCommand = async (input, context) => {
|
|
30
30
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
31
31
|
const headers = {};
|
|
32
32
|
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
@@ -46,8 +46,8 @@ const serializeAws_restJson1GetSessionCommand = async (input, context) => {
|
|
|
46
46
|
body,
|
|
47
47
|
});
|
|
48
48
|
};
|
|
49
|
-
exports.
|
|
50
|
-
const
|
|
49
|
+
exports.se_GetSessionCommand = se_GetSessionCommand;
|
|
50
|
+
const se_PutSessionCommand = async (input, context) => {
|
|
51
51
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
52
52
|
const headers = map({}, isSerializableHeaderValue, {
|
|
53
53
|
"content-type": "application/json",
|
|
@@ -61,13 +61,9 @@ const serializeAws_restJson1PutSessionCommand = async (input, context) => {
|
|
|
61
61
|
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "sessionId", () => input.sessionId, "{sessionId}", false);
|
|
62
62
|
let body;
|
|
63
63
|
body = JSON.stringify({
|
|
64
|
-
...(input.messages != null && { messages:
|
|
65
|
-
...(input.requestAttributes != null && {
|
|
66
|
-
|
|
67
|
-
}),
|
|
68
|
-
...(input.sessionState != null && {
|
|
69
|
-
sessionState: serializeAws_restJson1SessionState(input.sessionState, context),
|
|
70
|
-
}),
|
|
64
|
+
...(input.messages != null && { messages: se_Messages(input.messages, context) }),
|
|
65
|
+
...(input.requestAttributes != null && { requestAttributes: se_StringMap(input.requestAttributes, context) }),
|
|
66
|
+
...(input.sessionState != null && { sessionState: se_SessionState(input.sessionState, context) }),
|
|
71
67
|
});
|
|
72
68
|
return new protocol_http_1.HttpRequest({
|
|
73
69
|
protocol,
|
|
@@ -79,8 +75,8 @@ const serializeAws_restJson1PutSessionCommand = async (input, context) => {
|
|
|
79
75
|
body,
|
|
80
76
|
});
|
|
81
77
|
};
|
|
82
|
-
exports.
|
|
83
|
-
const
|
|
78
|
+
exports.se_PutSessionCommand = se_PutSessionCommand;
|
|
79
|
+
const se_RecognizeTextCommand = async (input, context) => {
|
|
84
80
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
85
81
|
const headers = {
|
|
86
82
|
"content-type": "application/json",
|
|
@@ -93,12 +89,8 @@ const serializeAws_restJson1RecognizeTextCommand = async (input, context) => {
|
|
|
93
89
|
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "sessionId", () => input.sessionId, "{sessionId}", false);
|
|
94
90
|
let body;
|
|
95
91
|
body = JSON.stringify({
|
|
96
|
-
...(input.requestAttributes != null && {
|
|
97
|
-
|
|
98
|
-
}),
|
|
99
|
-
...(input.sessionState != null && {
|
|
100
|
-
sessionState: serializeAws_restJson1SessionState(input.sessionState, context),
|
|
101
|
-
}),
|
|
92
|
+
...(input.requestAttributes != null && { requestAttributes: se_StringMap(input.requestAttributes, context) }),
|
|
93
|
+
...(input.sessionState != null && { sessionState: se_SessionState(input.sessionState, context) }),
|
|
102
94
|
...(input.text != null && { text: input.text }),
|
|
103
95
|
});
|
|
104
96
|
return new protocol_http_1.HttpRequest({
|
|
@@ -111,8 +103,8 @@ const serializeAws_restJson1RecognizeTextCommand = async (input, context) => {
|
|
|
111
103
|
body,
|
|
112
104
|
});
|
|
113
105
|
};
|
|
114
|
-
exports.
|
|
115
|
-
const
|
|
106
|
+
exports.se_RecognizeTextCommand = se_RecognizeTextCommand;
|
|
107
|
+
const se_RecognizeUtteranceCommand = async (input, context) => {
|
|
116
108
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
117
109
|
const headers = map({}, isSerializableHeaderValue, {
|
|
118
110
|
"x-amz-content-sha256": "UNSIGNED-PAYLOAD",
|
|
@@ -141,8 +133,8 @@ const serializeAws_restJson1RecognizeUtteranceCommand = async (input, context) =
|
|
|
141
133
|
body,
|
|
142
134
|
});
|
|
143
135
|
};
|
|
144
|
-
exports.
|
|
145
|
-
const
|
|
136
|
+
exports.se_RecognizeUtteranceCommand = se_RecognizeUtteranceCommand;
|
|
137
|
+
const se_StartConversationCommand = async (input, context) => {
|
|
146
138
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
147
139
|
const headers = map({}, isSerializableHeaderValue, {
|
|
148
140
|
"x-amz-lex-conversation-mode": input.conversationMode,
|
|
@@ -155,7 +147,7 @@ const serializeAws_restJson1StartConversationCommand = async (input, context) =>
|
|
|
155
147
|
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "sessionId", () => input.sessionId, "{sessionId}", false);
|
|
156
148
|
let body;
|
|
157
149
|
if (input.requestEventStream !== undefined) {
|
|
158
|
-
body =
|
|
150
|
+
body = se_StartConversationRequestEventStream(input.requestEventStream, context);
|
|
159
151
|
}
|
|
160
152
|
return new protocol_http_1.HttpRequest({
|
|
161
153
|
protocol,
|
|
@@ -167,10 +159,10 @@ const serializeAws_restJson1StartConversationCommand = async (input, context) =>
|
|
|
167
159
|
body,
|
|
168
160
|
});
|
|
169
161
|
};
|
|
170
|
-
exports.
|
|
171
|
-
const
|
|
162
|
+
exports.se_StartConversationCommand = se_StartConversationCommand;
|
|
163
|
+
const de_DeleteSessionCommand = async (output, context) => {
|
|
172
164
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
173
|
-
return
|
|
165
|
+
return de_DeleteSessionCommandError(output, context);
|
|
174
166
|
}
|
|
175
167
|
const contents = map({
|
|
176
168
|
$metadata: deserializeMetadata(output),
|
|
@@ -190,8 +182,8 @@ const deserializeAws_restJson1DeleteSessionCommand = async (output, context) =>
|
|
|
190
182
|
}
|
|
191
183
|
return contents;
|
|
192
184
|
};
|
|
193
|
-
exports.
|
|
194
|
-
const
|
|
185
|
+
exports.de_DeleteSessionCommand = de_DeleteSessionCommand;
|
|
186
|
+
const de_DeleteSessionCommandError = async (output, context) => {
|
|
195
187
|
const parsedOutput = {
|
|
196
188
|
...output,
|
|
197
189
|
body: await parseErrorBody(output.body, context),
|
|
@@ -200,22 +192,22 @@ const deserializeAws_restJson1DeleteSessionCommandError = async (output, context
|
|
|
200
192
|
switch (errorCode) {
|
|
201
193
|
case "AccessDeniedException":
|
|
202
194
|
case "com.amazonaws.lexruntimev2#AccessDeniedException":
|
|
203
|
-
throw await
|
|
195
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
204
196
|
case "ConflictException":
|
|
205
197
|
case "com.amazonaws.lexruntimev2#ConflictException":
|
|
206
|
-
throw await
|
|
198
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
207
199
|
case "InternalServerException":
|
|
208
200
|
case "com.amazonaws.lexruntimev2#InternalServerException":
|
|
209
|
-
throw await
|
|
201
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
210
202
|
case "ResourceNotFoundException":
|
|
211
203
|
case "com.amazonaws.lexruntimev2#ResourceNotFoundException":
|
|
212
|
-
throw await
|
|
204
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
213
205
|
case "ThrottlingException":
|
|
214
206
|
case "com.amazonaws.lexruntimev2#ThrottlingException":
|
|
215
|
-
throw await
|
|
207
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
216
208
|
case "ValidationException":
|
|
217
209
|
case "com.amazonaws.lexruntimev2#ValidationException":
|
|
218
|
-
throw await
|
|
210
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
219
211
|
default:
|
|
220
212
|
const parsedBody = parsedOutput.body;
|
|
221
213
|
(0, smithy_client_1.throwDefaultError)({
|
|
@@ -226,30 +218,30 @@ const deserializeAws_restJson1DeleteSessionCommandError = async (output, context
|
|
|
226
218
|
});
|
|
227
219
|
}
|
|
228
220
|
};
|
|
229
|
-
const
|
|
221
|
+
const de_GetSessionCommand = async (output, context) => {
|
|
230
222
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
231
|
-
return
|
|
223
|
+
return de_GetSessionCommandError(output, context);
|
|
232
224
|
}
|
|
233
225
|
const contents = map({
|
|
234
226
|
$metadata: deserializeMetadata(output),
|
|
235
227
|
});
|
|
236
228
|
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
237
229
|
if (data.interpretations != null) {
|
|
238
|
-
contents.interpretations =
|
|
230
|
+
contents.interpretations = de_Interpretations(data.interpretations, context);
|
|
239
231
|
}
|
|
240
232
|
if (data.messages != null) {
|
|
241
|
-
contents.messages =
|
|
233
|
+
contents.messages = de_Messages(data.messages, context);
|
|
242
234
|
}
|
|
243
235
|
if (data.sessionId != null) {
|
|
244
236
|
contents.sessionId = (0, smithy_client_1.expectString)(data.sessionId);
|
|
245
237
|
}
|
|
246
238
|
if (data.sessionState != null) {
|
|
247
|
-
contents.sessionState =
|
|
239
|
+
contents.sessionState = de_SessionState(data.sessionState, context);
|
|
248
240
|
}
|
|
249
241
|
return contents;
|
|
250
242
|
};
|
|
251
|
-
exports.
|
|
252
|
-
const
|
|
243
|
+
exports.de_GetSessionCommand = de_GetSessionCommand;
|
|
244
|
+
const de_GetSessionCommandError = async (output, context) => {
|
|
253
245
|
const parsedOutput = {
|
|
254
246
|
...output,
|
|
255
247
|
body: await parseErrorBody(output.body, context),
|
|
@@ -258,19 +250,19 @@ const deserializeAws_restJson1GetSessionCommandError = async (output, context) =
|
|
|
258
250
|
switch (errorCode) {
|
|
259
251
|
case "AccessDeniedException":
|
|
260
252
|
case "com.amazonaws.lexruntimev2#AccessDeniedException":
|
|
261
|
-
throw await
|
|
253
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
262
254
|
case "InternalServerException":
|
|
263
255
|
case "com.amazonaws.lexruntimev2#InternalServerException":
|
|
264
|
-
throw await
|
|
256
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
265
257
|
case "ResourceNotFoundException":
|
|
266
258
|
case "com.amazonaws.lexruntimev2#ResourceNotFoundException":
|
|
267
|
-
throw await
|
|
259
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
268
260
|
case "ThrottlingException":
|
|
269
261
|
case "com.amazonaws.lexruntimev2#ThrottlingException":
|
|
270
|
-
throw await
|
|
262
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
271
263
|
case "ValidationException":
|
|
272
264
|
case "com.amazonaws.lexruntimev2#ValidationException":
|
|
273
|
-
throw await
|
|
265
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
274
266
|
default:
|
|
275
267
|
const parsedBody = parsedOutput.body;
|
|
276
268
|
(0, smithy_client_1.throwDefaultError)({
|
|
@@ -281,9 +273,9 @@ const deserializeAws_restJson1GetSessionCommandError = async (output, context) =
|
|
|
281
273
|
});
|
|
282
274
|
}
|
|
283
275
|
};
|
|
284
|
-
const
|
|
276
|
+
const de_PutSessionCommand = async (output, context) => {
|
|
285
277
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
286
|
-
return
|
|
278
|
+
return de_PutSessionCommandError(output, context);
|
|
287
279
|
}
|
|
288
280
|
const contents = map({
|
|
289
281
|
$metadata: deserializeMetadata(output),
|
|
@@ -298,8 +290,8 @@ const deserializeAws_restJson1PutSessionCommand = async (output, context) => {
|
|
|
298
290
|
contents.audioStream = data;
|
|
299
291
|
return contents;
|
|
300
292
|
};
|
|
301
|
-
exports.
|
|
302
|
-
const
|
|
293
|
+
exports.de_PutSessionCommand = de_PutSessionCommand;
|
|
294
|
+
const de_PutSessionCommandError = async (output, context) => {
|
|
303
295
|
const parsedOutput = {
|
|
304
296
|
...output,
|
|
305
297
|
body: await parseErrorBody(output.body, context),
|
|
@@ -308,28 +300,28 @@ const deserializeAws_restJson1PutSessionCommandError = async (output, context) =
|
|
|
308
300
|
switch (errorCode) {
|
|
309
301
|
case "AccessDeniedException":
|
|
310
302
|
case "com.amazonaws.lexruntimev2#AccessDeniedException":
|
|
311
|
-
throw await
|
|
303
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
312
304
|
case "BadGatewayException":
|
|
313
305
|
case "com.amazonaws.lexruntimev2#BadGatewayException":
|
|
314
|
-
throw await
|
|
306
|
+
throw await de_BadGatewayExceptionRes(parsedOutput, context);
|
|
315
307
|
case "ConflictException":
|
|
316
308
|
case "com.amazonaws.lexruntimev2#ConflictException":
|
|
317
|
-
throw await
|
|
309
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
318
310
|
case "DependencyFailedException":
|
|
319
311
|
case "com.amazonaws.lexruntimev2#DependencyFailedException":
|
|
320
|
-
throw await
|
|
312
|
+
throw await de_DependencyFailedExceptionRes(parsedOutput, context);
|
|
321
313
|
case "InternalServerException":
|
|
322
314
|
case "com.amazonaws.lexruntimev2#InternalServerException":
|
|
323
|
-
throw await
|
|
315
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
324
316
|
case "ResourceNotFoundException":
|
|
325
317
|
case "com.amazonaws.lexruntimev2#ResourceNotFoundException":
|
|
326
|
-
throw await
|
|
318
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
327
319
|
case "ThrottlingException":
|
|
328
320
|
case "com.amazonaws.lexruntimev2#ThrottlingException":
|
|
329
|
-
throw await
|
|
321
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
330
322
|
case "ValidationException":
|
|
331
323
|
case "com.amazonaws.lexruntimev2#ValidationException":
|
|
332
|
-
throw await
|
|
324
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
333
325
|
default:
|
|
334
326
|
const parsedBody = parsedOutput.body;
|
|
335
327
|
(0, smithy_client_1.throwDefaultError)({
|
|
@@ -340,36 +332,36 @@ const deserializeAws_restJson1PutSessionCommandError = async (output, context) =
|
|
|
340
332
|
});
|
|
341
333
|
}
|
|
342
334
|
};
|
|
343
|
-
const
|
|
335
|
+
const de_RecognizeTextCommand = async (output, context) => {
|
|
344
336
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
345
|
-
return
|
|
337
|
+
return de_RecognizeTextCommandError(output, context);
|
|
346
338
|
}
|
|
347
339
|
const contents = map({
|
|
348
340
|
$metadata: deserializeMetadata(output),
|
|
349
341
|
});
|
|
350
342
|
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
351
343
|
if (data.interpretations != null) {
|
|
352
|
-
contents.interpretations =
|
|
344
|
+
contents.interpretations = de_Interpretations(data.interpretations, context);
|
|
353
345
|
}
|
|
354
346
|
if (data.messages != null) {
|
|
355
|
-
contents.messages =
|
|
347
|
+
contents.messages = de_Messages(data.messages, context);
|
|
356
348
|
}
|
|
357
349
|
if (data.recognizedBotMember != null) {
|
|
358
|
-
contents.recognizedBotMember =
|
|
350
|
+
contents.recognizedBotMember = de_RecognizedBotMember(data.recognizedBotMember, context);
|
|
359
351
|
}
|
|
360
352
|
if (data.requestAttributes != null) {
|
|
361
|
-
contents.requestAttributes =
|
|
353
|
+
contents.requestAttributes = de_StringMap(data.requestAttributes, context);
|
|
362
354
|
}
|
|
363
355
|
if (data.sessionId != null) {
|
|
364
356
|
contents.sessionId = (0, smithy_client_1.expectString)(data.sessionId);
|
|
365
357
|
}
|
|
366
358
|
if (data.sessionState != null) {
|
|
367
|
-
contents.sessionState =
|
|
359
|
+
contents.sessionState = de_SessionState(data.sessionState, context);
|
|
368
360
|
}
|
|
369
361
|
return contents;
|
|
370
362
|
};
|
|
371
|
-
exports.
|
|
372
|
-
const
|
|
363
|
+
exports.de_RecognizeTextCommand = de_RecognizeTextCommand;
|
|
364
|
+
const de_RecognizeTextCommandError = async (output, context) => {
|
|
373
365
|
const parsedOutput = {
|
|
374
366
|
...output,
|
|
375
367
|
body: await parseErrorBody(output.body, context),
|
|
@@ -378,28 +370,28 @@ const deserializeAws_restJson1RecognizeTextCommandError = async (output, context
|
|
|
378
370
|
switch (errorCode) {
|
|
379
371
|
case "AccessDeniedException":
|
|
380
372
|
case "com.amazonaws.lexruntimev2#AccessDeniedException":
|
|
381
|
-
throw await
|
|
373
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
382
374
|
case "BadGatewayException":
|
|
383
375
|
case "com.amazonaws.lexruntimev2#BadGatewayException":
|
|
384
|
-
throw await
|
|
376
|
+
throw await de_BadGatewayExceptionRes(parsedOutput, context);
|
|
385
377
|
case "ConflictException":
|
|
386
378
|
case "com.amazonaws.lexruntimev2#ConflictException":
|
|
387
|
-
throw await
|
|
379
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
388
380
|
case "DependencyFailedException":
|
|
389
381
|
case "com.amazonaws.lexruntimev2#DependencyFailedException":
|
|
390
|
-
throw await
|
|
382
|
+
throw await de_DependencyFailedExceptionRes(parsedOutput, context);
|
|
391
383
|
case "InternalServerException":
|
|
392
384
|
case "com.amazonaws.lexruntimev2#InternalServerException":
|
|
393
|
-
throw await
|
|
385
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
394
386
|
case "ResourceNotFoundException":
|
|
395
387
|
case "com.amazonaws.lexruntimev2#ResourceNotFoundException":
|
|
396
|
-
throw await
|
|
388
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
397
389
|
case "ThrottlingException":
|
|
398
390
|
case "com.amazonaws.lexruntimev2#ThrottlingException":
|
|
399
|
-
throw await
|
|
391
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
400
392
|
case "ValidationException":
|
|
401
393
|
case "com.amazonaws.lexruntimev2#ValidationException":
|
|
402
|
-
throw await
|
|
394
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
403
395
|
default:
|
|
404
396
|
const parsedBody = parsedOutput.body;
|
|
405
397
|
(0, smithy_client_1.throwDefaultError)({
|
|
@@ -410,9 +402,9 @@ const deserializeAws_restJson1RecognizeTextCommandError = async (output, context
|
|
|
410
402
|
});
|
|
411
403
|
}
|
|
412
404
|
};
|
|
413
|
-
const
|
|
405
|
+
const de_RecognizeUtteranceCommand = async (output, context) => {
|
|
414
406
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
415
|
-
return
|
|
407
|
+
return de_RecognizeUtteranceCommandError(output, context);
|
|
416
408
|
}
|
|
417
409
|
const contents = map({
|
|
418
410
|
$metadata: deserializeMetadata(output),
|
|
@@ -431,8 +423,8 @@ const deserializeAws_restJson1RecognizeUtteranceCommand = async (output, context
|
|
|
431
423
|
contents.audioStream = data;
|
|
432
424
|
return contents;
|
|
433
425
|
};
|
|
434
|
-
exports.
|
|
435
|
-
const
|
|
426
|
+
exports.de_RecognizeUtteranceCommand = de_RecognizeUtteranceCommand;
|
|
427
|
+
const de_RecognizeUtteranceCommandError = async (output, context) => {
|
|
436
428
|
const parsedOutput = {
|
|
437
429
|
...output,
|
|
438
430
|
body: await parseErrorBody(output.body, context),
|
|
@@ -441,28 +433,28 @@ const deserializeAws_restJson1RecognizeUtteranceCommandError = async (output, co
|
|
|
441
433
|
switch (errorCode) {
|
|
442
434
|
case "AccessDeniedException":
|
|
443
435
|
case "com.amazonaws.lexruntimev2#AccessDeniedException":
|
|
444
|
-
throw await
|
|
436
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
445
437
|
case "BadGatewayException":
|
|
446
438
|
case "com.amazonaws.lexruntimev2#BadGatewayException":
|
|
447
|
-
throw await
|
|
439
|
+
throw await de_BadGatewayExceptionRes(parsedOutput, context);
|
|
448
440
|
case "ConflictException":
|
|
449
441
|
case "com.amazonaws.lexruntimev2#ConflictException":
|
|
450
|
-
throw await
|
|
442
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
451
443
|
case "DependencyFailedException":
|
|
452
444
|
case "com.amazonaws.lexruntimev2#DependencyFailedException":
|
|
453
|
-
throw await
|
|
445
|
+
throw await de_DependencyFailedExceptionRes(parsedOutput, context);
|
|
454
446
|
case "InternalServerException":
|
|
455
447
|
case "com.amazonaws.lexruntimev2#InternalServerException":
|
|
456
|
-
throw await
|
|
448
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
457
449
|
case "ResourceNotFoundException":
|
|
458
450
|
case "com.amazonaws.lexruntimev2#ResourceNotFoundException":
|
|
459
|
-
throw await
|
|
451
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
460
452
|
case "ThrottlingException":
|
|
461
453
|
case "com.amazonaws.lexruntimev2#ThrottlingException":
|
|
462
|
-
throw await
|
|
454
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
463
455
|
case "ValidationException":
|
|
464
456
|
case "com.amazonaws.lexruntimev2#ValidationException":
|
|
465
|
-
throw await
|
|
457
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
466
458
|
default:
|
|
467
459
|
const parsedBody = parsedOutput.body;
|
|
468
460
|
(0, smithy_client_1.throwDefaultError)({
|
|
@@ -473,19 +465,19 @@ const deserializeAws_restJson1RecognizeUtteranceCommandError = async (output, co
|
|
|
473
465
|
});
|
|
474
466
|
}
|
|
475
467
|
};
|
|
476
|
-
const
|
|
468
|
+
const de_StartConversationCommand = async (output, context) => {
|
|
477
469
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
478
|
-
return
|
|
470
|
+
return de_StartConversationCommandError(output, context);
|
|
479
471
|
}
|
|
480
472
|
const contents = map({
|
|
481
473
|
$metadata: deserializeMetadata(output),
|
|
482
474
|
});
|
|
483
475
|
const data = output.body;
|
|
484
|
-
contents.responseEventStream =
|
|
476
|
+
contents.responseEventStream = de_StartConversationResponseEventStream(data, context);
|
|
485
477
|
return contents;
|
|
486
478
|
};
|
|
487
|
-
exports.
|
|
488
|
-
const
|
|
479
|
+
exports.de_StartConversationCommand = de_StartConversationCommand;
|
|
480
|
+
const de_StartConversationCommandError = async (output, context) => {
|
|
489
481
|
const parsedOutput = {
|
|
490
482
|
...output,
|
|
491
483
|
body: await parseErrorBody(output.body, context),
|
|
@@ -494,16 +486,16 @@ const deserializeAws_restJson1StartConversationCommandError = async (output, con
|
|
|
494
486
|
switch (errorCode) {
|
|
495
487
|
case "AccessDeniedException":
|
|
496
488
|
case "com.amazonaws.lexruntimev2#AccessDeniedException":
|
|
497
|
-
throw await
|
|
489
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
498
490
|
case "InternalServerException":
|
|
499
491
|
case "com.amazonaws.lexruntimev2#InternalServerException":
|
|
500
|
-
throw await
|
|
492
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
501
493
|
case "ThrottlingException":
|
|
502
494
|
case "com.amazonaws.lexruntimev2#ThrottlingException":
|
|
503
|
-
throw await
|
|
495
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
504
496
|
case "ValidationException":
|
|
505
497
|
case "com.amazonaws.lexruntimev2#ValidationException":
|
|
506
|
-
throw await
|
|
498
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
507
499
|
default:
|
|
508
500
|
const parsedBody = parsedOutput.body;
|
|
509
501
|
(0, smithy_client_1.throwDefaultError)({
|
|
@@ -515,7 +507,7 @@ const deserializeAws_restJson1StartConversationCommandError = async (output, con
|
|
|
515
507
|
}
|
|
516
508
|
};
|
|
517
509
|
const map = smithy_client_1.map;
|
|
518
|
-
const
|
|
510
|
+
const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
|
|
519
511
|
const contents = map({});
|
|
520
512
|
const data = parsedOutput.body;
|
|
521
513
|
if (data.message != null) {
|
|
@@ -527,7 +519,7 @@ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutpu
|
|
|
527
519
|
});
|
|
528
520
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
529
521
|
};
|
|
530
|
-
const
|
|
522
|
+
const de_BadGatewayExceptionRes = async (parsedOutput, context) => {
|
|
531
523
|
const contents = map({});
|
|
532
524
|
const data = parsedOutput.body;
|
|
533
525
|
if (data.message != null) {
|
|
@@ -539,7 +531,7 @@ const deserializeAws_restJson1BadGatewayExceptionResponse = async (parsedOutput,
|
|
|
539
531
|
});
|
|
540
532
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
541
533
|
};
|
|
542
|
-
const
|
|
534
|
+
const de_ConflictExceptionRes = async (parsedOutput, context) => {
|
|
543
535
|
const contents = map({});
|
|
544
536
|
const data = parsedOutput.body;
|
|
545
537
|
if (data.message != null) {
|
|
@@ -551,7 +543,7 @@ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, c
|
|
|
551
543
|
});
|
|
552
544
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
553
545
|
};
|
|
554
|
-
const
|
|
546
|
+
const de_DependencyFailedExceptionRes = async (parsedOutput, context) => {
|
|
555
547
|
const contents = map({});
|
|
556
548
|
const data = parsedOutput.body;
|
|
557
549
|
if (data.message != null) {
|
|
@@ -563,7 +555,7 @@ const deserializeAws_restJson1DependencyFailedExceptionResponse = async (parsedO
|
|
|
563
555
|
});
|
|
564
556
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
565
557
|
};
|
|
566
|
-
const
|
|
558
|
+
const de_InternalServerExceptionRes = async (parsedOutput, context) => {
|
|
567
559
|
const contents = map({});
|
|
568
560
|
const data = parsedOutput.body;
|
|
569
561
|
if (data.message != null) {
|
|
@@ -575,7 +567,7 @@ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOut
|
|
|
575
567
|
});
|
|
576
568
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
577
569
|
};
|
|
578
|
-
const
|
|
570
|
+
const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
579
571
|
const contents = map({});
|
|
580
572
|
const data = parsedOutput.body;
|
|
581
573
|
if (data.message != null) {
|
|
@@ -587,7 +579,7 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
|
|
|
587
579
|
});
|
|
588
580
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
589
581
|
};
|
|
590
|
-
const
|
|
582
|
+
const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
|
|
591
583
|
const contents = map({});
|
|
592
584
|
const data = parsedOutput.body;
|
|
593
585
|
if (data.message != null) {
|
|
@@ -599,7 +591,7 @@ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput,
|
|
|
599
591
|
});
|
|
600
592
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
601
593
|
};
|
|
602
|
-
const
|
|
594
|
+
const de_ValidationExceptionRes = async (parsedOutput, context) => {
|
|
603
595
|
const contents = map({});
|
|
604
596
|
const data = parsedOutput.body;
|
|
605
597
|
if (data.message != null) {
|
|
@@ -611,263 +603,261 @@ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput,
|
|
|
611
603
|
});
|
|
612
604
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
613
605
|
};
|
|
614
|
-
const
|
|
606
|
+
const se_StartConversationRequestEventStream = (input, context) => {
|
|
615
607
|
const eventMarshallingVisitor = (event) => models_0_1.StartConversationRequestEventStream.visit(event, {
|
|
616
|
-
ConfigurationEvent: (value) =>
|
|
617
|
-
AudioInputEvent: (value) =>
|
|
618
|
-
DTMFInputEvent: (value) =>
|
|
619
|
-
TextInputEvent: (value) =>
|
|
620
|
-
PlaybackCompletionEvent: (value) =>
|
|
621
|
-
DisconnectionEvent: (value) =>
|
|
608
|
+
ConfigurationEvent: (value) => se_ConfigurationEvent_event(value, context),
|
|
609
|
+
AudioInputEvent: (value) => se_AudioInputEvent_event(value, context),
|
|
610
|
+
DTMFInputEvent: (value) => se_DTMFInputEvent_event(value, context),
|
|
611
|
+
TextInputEvent: (value) => se_TextInputEvent_event(value, context),
|
|
612
|
+
PlaybackCompletionEvent: (value) => se_PlaybackCompletionEvent_event(value, context),
|
|
613
|
+
DisconnectionEvent: (value) => se_DisconnectionEvent_event(value, context),
|
|
622
614
|
_: (value) => value,
|
|
623
615
|
});
|
|
624
616
|
return context.eventStreamMarshaller.serialize(input, eventMarshallingVisitor);
|
|
625
617
|
};
|
|
626
|
-
const
|
|
618
|
+
const se_AudioInputEvent_event = (input, context) => {
|
|
627
619
|
const headers = {
|
|
628
620
|
":event-type": { type: "string", value: "AudioInputEvent" },
|
|
629
621
|
":message-type": { type: "string", value: "event" },
|
|
630
622
|
":content-type": { type: "string", value: "application/json" },
|
|
631
623
|
};
|
|
632
624
|
let body = new Uint8Array();
|
|
633
|
-
body =
|
|
625
|
+
body = se_AudioInputEvent(input, context);
|
|
634
626
|
body = context.utf8Decoder(JSON.stringify(body));
|
|
635
627
|
return { headers, body };
|
|
636
628
|
};
|
|
637
|
-
const
|
|
629
|
+
const se_ConfigurationEvent_event = (input, context) => {
|
|
638
630
|
const headers = {
|
|
639
631
|
":event-type": { type: "string", value: "ConfigurationEvent" },
|
|
640
632
|
":message-type": { type: "string", value: "event" },
|
|
641
633
|
":content-type": { type: "string", value: "application/json" },
|
|
642
634
|
};
|
|
643
635
|
let body = new Uint8Array();
|
|
644
|
-
body =
|
|
636
|
+
body = se_ConfigurationEvent(input, context);
|
|
645
637
|
body = context.utf8Decoder(JSON.stringify(body));
|
|
646
638
|
return { headers, body };
|
|
647
639
|
};
|
|
648
|
-
const
|
|
640
|
+
const se_DisconnectionEvent_event = (input, context) => {
|
|
649
641
|
const headers = {
|
|
650
642
|
":event-type": { type: "string", value: "DisconnectionEvent" },
|
|
651
643
|
":message-type": { type: "string", value: "event" },
|
|
652
644
|
":content-type": { type: "string", value: "application/json" },
|
|
653
645
|
};
|
|
654
646
|
let body = new Uint8Array();
|
|
655
|
-
body =
|
|
647
|
+
body = se_DisconnectionEvent(input, context);
|
|
656
648
|
body = context.utf8Decoder(JSON.stringify(body));
|
|
657
649
|
return { headers, body };
|
|
658
650
|
};
|
|
659
|
-
const
|
|
651
|
+
const se_DTMFInputEvent_event = (input, context) => {
|
|
660
652
|
const headers = {
|
|
661
653
|
":event-type": { type: "string", value: "DTMFInputEvent" },
|
|
662
654
|
":message-type": { type: "string", value: "event" },
|
|
663
655
|
":content-type": { type: "string", value: "application/json" },
|
|
664
656
|
};
|
|
665
657
|
let body = new Uint8Array();
|
|
666
|
-
body =
|
|
658
|
+
body = se_DTMFInputEvent(input, context);
|
|
667
659
|
body = context.utf8Decoder(JSON.stringify(body));
|
|
668
660
|
return { headers, body };
|
|
669
661
|
};
|
|
670
|
-
const
|
|
662
|
+
const se_PlaybackCompletionEvent_event = (input, context) => {
|
|
671
663
|
const headers = {
|
|
672
664
|
":event-type": { type: "string", value: "PlaybackCompletionEvent" },
|
|
673
665
|
":message-type": { type: "string", value: "event" },
|
|
674
666
|
":content-type": { type: "string", value: "application/json" },
|
|
675
667
|
};
|
|
676
668
|
let body = new Uint8Array();
|
|
677
|
-
body =
|
|
669
|
+
body = se_PlaybackCompletionEvent(input, context);
|
|
678
670
|
body = context.utf8Decoder(JSON.stringify(body));
|
|
679
671
|
return { headers, body };
|
|
680
672
|
};
|
|
681
|
-
const
|
|
673
|
+
const se_TextInputEvent_event = (input, context) => {
|
|
682
674
|
const headers = {
|
|
683
675
|
":event-type": { type: "string", value: "TextInputEvent" },
|
|
684
676
|
":message-type": { type: "string", value: "event" },
|
|
685
677
|
":content-type": { type: "string", value: "application/json" },
|
|
686
678
|
};
|
|
687
679
|
let body = new Uint8Array();
|
|
688
|
-
body =
|
|
680
|
+
body = se_TextInputEvent(input, context);
|
|
689
681
|
body = context.utf8Decoder(JSON.stringify(body));
|
|
690
682
|
return { headers, body };
|
|
691
683
|
};
|
|
692
|
-
const
|
|
684
|
+
const de_StartConversationResponseEventStream = (output, context) => {
|
|
693
685
|
return context.eventStreamMarshaller.deserialize(output, async (event) => {
|
|
694
686
|
if (event["PlaybackInterruptionEvent"] != null) {
|
|
695
687
|
return {
|
|
696
|
-
PlaybackInterruptionEvent: await
|
|
688
|
+
PlaybackInterruptionEvent: await de_PlaybackInterruptionEvent_event(event["PlaybackInterruptionEvent"], context),
|
|
697
689
|
};
|
|
698
690
|
}
|
|
699
691
|
if (event["TranscriptEvent"] != null) {
|
|
700
692
|
return {
|
|
701
|
-
TranscriptEvent: await
|
|
693
|
+
TranscriptEvent: await de_TranscriptEvent_event(event["TranscriptEvent"], context),
|
|
702
694
|
};
|
|
703
695
|
}
|
|
704
696
|
if (event["IntentResultEvent"] != null) {
|
|
705
697
|
return {
|
|
706
|
-
IntentResultEvent: await
|
|
698
|
+
IntentResultEvent: await de_IntentResultEvent_event(event["IntentResultEvent"], context),
|
|
707
699
|
};
|
|
708
700
|
}
|
|
709
701
|
if (event["TextResponseEvent"] != null) {
|
|
710
702
|
return {
|
|
711
|
-
TextResponseEvent: await
|
|
703
|
+
TextResponseEvent: await de_TextResponseEvent_event(event["TextResponseEvent"], context),
|
|
712
704
|
};
|
|
713
705
|
}
|
|
714
706
|
if (event["AudioResponseEvent"] != null) {
|
|
715
707
|
return {
|
|
716
|
-
AudioResponseEvent: await
|
|
708
|
+
AudioResponseEvent: await de_AudioResponseEvent_event(event["AudioResponseEvent"], context),
|
|
717
709
|
};
|
|
718
710
|
}
|
|
719
711
|
if (event["HeartbeatEvent"] != null) {
|
|
720
712
|
return {
|
|
721
|
-
HeartbeatEvent: await
|
|
713
|
+
HeartbeatEvent: await de_HeartbeatEvent_event(event["HeartbeatEvent"], context),
|
|
722
714
|
};
|
|
723
715
|
}
|
|
724
716
|
if (event["AccessDeniedException"] != null) {
|
|
725
717
|
return {
|
|
726
|
-
AccessDeniedException: await
|
|
718
|
+
AccessDeniedException: await de_AccessDeniedException_event(event["AccessDeniedException"], context),
|
|
727
719
|
};
|
|
728
720
|
}
|
|
729
721
|
if (event["ResourceNotFoundException"] != null) {
|
|
730
722
|
return {
|
|
731
|
-
ResourceNotFoundException: await
|
|
723
|
+
ResourceNotFoundException: await de_ResourceNotFoundException_event(event["ResourceNotFoundException"], context),
|
|
732
724
|
};
|
|
733
725
|
}
|
|
734
726
|
if (event["ValidationException"] != null) {
|
|
735
727
|
return {
|
|
736
|
-
ValidationException: await
|
|
728
|
+
ValidationException: await de_ValidationException_event(event["ValidationException"], context),
|
|
737
729
|
};
|
|
738
730
|
}
|
|
739
731
|
if (event["ThrottlingException"] != null) {
|
|
740
732
|
return {
|
|
741
|
-
ThrottlingException: await
|
|
733
|
+
ThrottlingException: await de_ThrottlingException_event(event["ThrottlingException"], context),
|
|
742
734
|
};
|
|
743
735
|
}
|
|
744
736
|
if (event["InternalServerException"] != null) {
|
|
745
737
|
return {
|
|
746
|
-
InternalServerException: await
|
|
738
|
+
InternalServerException: await de_InternalServerException_event(event["InternalServerException"], context),
|
|
747
739
|
};
|
|
748
740
|
}
|
|
749
741
|
if (event["ConflictException"] != null) {
|
|
750
742
|
return {
|
|
751
|
-
ConflictException: await
|
|
743
|
+
ConflictException: await de_ConflictException_event(event["ConflictException"], context),
|
|
752
744
|
};
|
|
753
745
|
}
|
|
754
746
|
if (event["DependencyFailedException"] != null) {
|
|
755
747
|
return {
|
|
756
|
-
DependencyFailedException: await
|
|
748
|
+
DependencyFailedException: await de_DependencyFailedException_event(event["DependencyFailedException"], context),
|
|
757
749
|
};
|
|
758
750
|
}
|
|
759
751
|
if (event["BadGatewayException"] != null) {
|
|
760
752
|
return {
|
|
761
|
-
BadGatewayException: await
|
|
753
|
+
BadGatewayException: await de_BadGatewayException_event(event["BadGatewayException"], context),
|
|
762
754
|
};
|
|
763
755
|
}
|
|
764
756
|
return { $unknown: output };
|
|
765
757
|
});
|
|
766
758
|
};
|
|
767
|
-
const
|
|
759
|
+
const de_AccessDeniedException_event = async (output, context) => {
|
|
768
760
|
const parsedOutput = {
|
|
769
761
|
...output,
|
|
770
762
|
body: await parseBody(output.body, context),
|
|
771
763
|
};
|
|
772
|
-
return
|
|
764
|
+
return de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
773
765
|
};
|
|
774
|
-
const
|
|
766
|
+
const de_AudioResponseEvent_event = async (output, context) => {
|
|
775
767
|
const contents = {};
|
|
776
768
|
const data = await parseBody(output.body, context);
|
|
777
|
-
Object.assign(contents,
|
|
769
|
+
Object.assign(contents, de_AudioResponseEvent(data, context));
|
|
778
770
|
return contents;
|
|
779
771
|
};
|
|
780
|
-
const
|
|
772
|
+
const de_BadGatewayException_event = async (output, context) => {
|
|
781
773
|
const parsedOutput = {
|
|
782
774
|
...output,
|
|
783
775
|
body: await parseBody(output.body, context),
|
|
784
776
|
};
|
|
785
|
-
return
|
|
777
|
+
return de_BadGatewayExceptionRes(parsedOutput, context);
|
|
786
778
|
};
|
|
787
|
-
const
|
|
779
|
+
const de_ConflictException_event = async (output, context) => {
|
|
788
780
|
const parsedOutput = {
|
|
789
781
|
...output,
|
|
790
782
|
body: await parseBody(output.body, context),
|
|
791
783
|
};
|
|
792
|
-
return
|
|
784
|
+
return de_ConflictExceptionRes(parsedOutput, context);
|
|
793
785
|
};
|
|
794
|
-
const
|
|
786
|
+
const de_DependencyFailedException_event = async (output, context) => {
|
|
795
787
|
const parsedOutput = {
|
|
796
788
|
...output,
|
|
797
789
|
body: await parseBody(output.body, context),
|
|
798
790
|
};
|
|
799
|
-
return
|
|
791
|
+
return de_DependencyFailedExceptionRes(parsedOutput, context);
|
|
800
792
|
};
|
|
801
|
-
const
|
|
793
|
+
const de_HeartbeatEvent_event = async (output, context) => {
|
|
802
794
|
const contents = {};
|
|
803
795
|
const data = await parseBody(output.body, context);
|
|
804
|
-
Object.assign(contents,
|
|
796
|
+
Object.assign(contents, de_HeartbeatEvent(data, context));
|
|
805
797
|
return contents;
|
|
806
798
|
};
|
|
807
|
-
const
|
|
799
|
+
const de_IntentResultEvent_event = async (output, context) => {
|
|
808
800
|
const contents = {};
|
|
809
801
|
const data = await parseBody(output.body, context);
|
|
810
|
-
Object.assign(contents,
|
|
802
|
+
Object.assign(contents, de_IntentResultEvent(data, context));
|
|
811
803
|
return contents;
|
|
812
804
|
};
|
|
813
|
-
const
|
|
805
|
+
const de_InternalServerException_event = async (output, context) => {
|
|
814
806
|
const parsedOutput = {
|
|
815
807
|
...output,
|
|
816
808
|
body: await parseBody(output.body, context),
|
|
817
809
|
};
|
|
818
|
-
return
|
|
810
|
+
return de_InternalServerExceptionRes(parsedOutput, context);
|
|
819
811
|
};
|
|
820
|
-
const
|
|
812
|
+
const de_PlaybackInterruptionEvent_event = async (output, context) => {
|
|
821
813
|
const contents = {};
|
|
822
814
|
const data = await parseBody(output.body, context);
|
|
823
|
-
Object.assign(contents,
|
|
815
|
+
Object.assign(contents, de_PlaybackInterruptionEvent(data, context));
|
|
824
816
|
return contents;
|
|
825
817
|
};
|
|
826
|
-
const
|
|
818
|
+
const de_ResourceNotFoundException_event = async (output, context) => {
|
|
827
819
|
const parsedOutput = {
|
|
828
820
|
...output,
|
|
829
821
|
body: await parseBody(output.body, context),
|
|
830
822
|
};
|
|
831
|
-
return
|
|
823
|
+
return de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
832
824
|
};
|
|
833
|
-
const
|
|
825
|
+
const de_TextResponseEvent_event = async (output, context) => {
|
|
834
826
|
const contents = {};
|
|
835
827
|
const data = await parseBody(output.body, context);
|
|
836
|
-
Object.assign(contents,
|
|
828
|
+
Object.assign(contents, de_TextResponseEvent(data, context));
|
|
837
829
|
return contents;
|
|
838
830
|
};
|
|
839
|
-
const
|
|
831
|
+
const de_ThrottlingException_event = async (output, context) => {
|
|
840
832
|
const parsedOutput = {
|
|
841
833
|
...output,
|
|
842
834
|
body: await parseBody(output.body, context),
|
|
843
835
|
};
|
|
844
|
-
return
|
|
836
|
+
return de_ThrottlingExceptionRes(parsedOutput, context);
|
|
845
837
|
};
|
|
846
|
-
const
|
|
838
|
+
const de_TranscriptEvent_event = async (output, context) => {
|
|
847
839
|
const contents = {};
|
|
848
840
|
const data = await parseBody(output.body, context);
|
|
849
|
-
Object.assign(contents,
|
|
841
|
+
Object.assign(contents, de_TranscriptEvent(data, context));
|
|
850
842
|
return contents;
|
|
851
843
|
};
|
|
852
|
-
const
|
|
844
|
+
const de_ValidationException_event = async (output, context) => {
|
|
853
845
|
const parsedOutput = {
|
|
854
846
|
...output,
|
|
855
847
|
body: await parseBody(output.body, context),
|
|
856
848
|
};
|
|
857
|
-
return
|
|
849
|
+
return de_ValidationExceptionRes(parsedOutput, context);
|
|
858
850
|
};
|
|
859
|
-
const
|
|
851
|
+
const se_ActiveContext = (input, context) => {
|
|
860
852
|
return {
|
|
861
853
|
...(input.contextAttributes != null && {
|
|
862
|
-
contextAttributes:
|
|
854
|
+
contextAttributes: se_ActiveContextParametersMap(input.contextAttributes, context),
|
|
863
855
|
}),
|
|
864
856
|
...(input.name != null && { name: input.name }),
|
|
865
|
-
...(input.timeToLive != null && {
|
|
866
|
-
timeToLive: serializeAws_restJson1ActiveContextTimeToLive(input.timeToLive, context),
|
|
867
|
-
}),
|
|
857
|
+
...(input.timeToLive != null && { timeToLive: se_ActiveContextTimeToLive(input.timeToLive, context) }),
|
|
868
858
|
};
|
|
869
859
|
};
|
|
870
|
-
const
|
|
860
|
+
const se_ActiveContextParametersMap = (input, context) => {
|
|
871
861
|
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
872
862
|
if (value === null) {
|
|
873
863
|
return acc;
|
|
@@ -876,20 +866,20 @@ const serializeAws_restJson1ActiveContextParametersMap = (input, context) => {
|
|
|
876
866
|
return acc;
|
|
877
867
|
}, {});
|
|
878
868
|
};
|
|
879
|
-
const
|
|
869
|
+
const se_ActiveContextsList = (input, context) => {
|
|
880
870
|
return input
|
|
881
871
|
.filter((e) => e != null)
|
|
882
872
|
.map((entry) => {
|
|
883
|
-
return
|
|
873
|
+
return se_ActiveContext(entry, context);
|
|
884
874
|
});
|
|
885
875
|
};
|
|
886
|
-
const
|
|
876
|
+
const se_ActiveContextTimeToLive = (input, context) => {
|
|
887
877
|
return {
|
|
888
878
|
...(input.timeToLiveInSeconds != null && { timeToLiveInSeconds: input.timeToLiveInSeconds }),
|
|
889
879
|
...(input.turnsToLive != null && { turnsToLive: input.turnsToLive }),
|
|
890
880
|
};
|
|
891
881
|
};
|
|
892
|
-
const
|
|
882
|
+
const se_AudioInputEvent = (input, context) => {
|
|
893
883
|
return {
|
|
894
884
|
...(input.audioChunk != null && { audioChunk: context.base64Encoder(input.audioChunk) }),
|
|
895
885
|
...(input.clientTimestampMillis != null && { clientTimestampMillis: input.clientTimestampMillis }),
|
|
@@ -897,193 +887,173 @@ const serializeAws_restJson1AudioInputEvent = (input, context) => {
|
|
|
897
887
|
...(input.eventId != null && { eventId: input.eventId }),
|
|
898
888
|
};
|
|
899
889
|
};
|
|
900
|
-
const
|
|
890
|
+
const se_Button = (input, context) => {
|
|
901
891
|
return {
|
|
902
892
|
...(input.text != null && { text: input.text }),
|
|
903
893
|
...(input.value != null && { value: input.value }),
|
|
904
894
|
};
|
|
905
895
|
};
|
|
906
|
-
const
|
|
896
|
+
const se_ButtonsList = (input, context) => {
|
|
907
897
|
return input
|
|
908
898
|
.filter((e) => e != null)
|
|
909
899
|
.map((entry) => {
|
|
910
|
-
return
|
|
900
|
+
return se_Button(entry, context);
|
|
911
901
|
});
|
|
912
902
|
};
|
|
913
|
-
const
|
|
903
|
+
const se_ConfigurationEvent = (input, context) => {
|
|
914
904
|
return {
|
|
915
905
|
...(input.clientTimestampMillis != null && { clientTimestampMillis: input.clientTimestampMillis }),
|
|
916
906
|
...(input.disablePlayback != null && { disablePlayback: input.disablePlayback }),
|
|
917
907
|
...(input.eventId != null && { eventId: input.eventId }),
|
|
918
|
-
...(input.requestAttributes != null && {
|
|
919
|
-
requestAttributes: serializeAws_restJson1StringMap(input.requestAttributes, context),
|
|
920
|
-
}),
|
|
908
|
+
...(input.requestAttributes != null && { requestAttributes: se_StringMap(input.requestAttributes, context) }),
|
|
921
909
|
...(input.responseContentType != null && { responseContentType: input.responseContentType }),
|
|
922
|
-
...(input.sessionState != null && {
|
|
923
|
-
|
|
924
|
-
}),
|
|
925
|
-
...(input.welcomeMessages != null && {
|
|
926
|
-
welcomeMessages: serializeAws_restJson1Messages(input.welcomeMessages, context),
|
|
927
|
-
}),
|
|
910
|
+
...(input.sessionState != null && { sessionState: se_SessionState(input.sessionState, context) }),
|
|
911
|
+
...(input.welcomeMessages != null && { welcomeMessages: se_Messages(input.welcomeMessages, context) }),
|
|
928
912
|
};
|
|
929
913
|
};
|
|
930
|
-
const
|
|
914
|
+
const se_DialogAction = (input, context) => {
|
|
931
915
|
return {
|
|
932
916
|
...(input.slotElicitationStyle != null && { slotElicitationStyle: input.slotElicitationStyle }),
|
|
933
917
|
...(input.slotToElicit != null && { slotToElicit: input.slotToElicit }),
|
|
934
|
-
...(input.subSlotToElicit != null && {
|
|
935
|
-
subSlotToElicit: serializeAws_restJson1ElicitSubSlot(input.subSlotToElicit, context),
|
|
936
|
-
}),
|
|
918
|
+
...(input.subSlotToElicit != null && { subSlotToElicit: se_ElicitSubSlot(input.subSlotToElicit, context) }),
|
|
937
919
|
...(input.type != null && { type: input.type }),
|
|
938
920
|
};
|
|
939
921
|
};
|
|
940
|
-
const
|
|
922
|
+
const se_DisconnectionEvent = (input, context) => {
|
|
941
923
|
return {
|
|
942
924
|
...(input.clientTimestampMillis != null && { clientTimestampMillis: input.clientTimestampMillis }),
|
|
943
925
|
...(input.eventId != null && { eventId: input.eventId }),
|
|
944
926
|
};
|
|
945
927
|
};
|
|
946
|
-
const
|
|
928
|
+
const se_DTMFInputEvent = (input, context) => {
|
|
947
929
|
return {
|
|
948
930
|
...(input.clientTimestampMillis != null && { clientTimestampMillis: input.clientTimestampMillis }),
|
|
949
931
|
...(input.eventId != null && { eventId: input.eventId }),
|
|
950
932
|
...(input.inputCharacter != null && { inputCharacter: input.inputCharacter }),
|
|
951
933
|
};
|
|
952
934
|
};
|
|
953
|
-
const
|
|
935
|
+
const se_ElicitSubSlot = (input, context) => {
|
|
954
936
|
return {
|
|
955
937
|
...(input.name != null && { name: input.name }),
|
|
956
|
-
...(input.subSlotToElicit != null && {
|
|
957
|
-
subSlotToElicit: serializeAws_restJson1ElicitSubSlot(input.subSlotToElicit, context),
|
|
958
|
-
}),
|
|
938
|
+
...(input.subSlotToElicit != null && { subSlotToElicit: se_ElicitSubSlot(input.subSlotToElicit, context) }),
|
|
959
939
|
};
|
|
960
940
|
};
|
|
961
|
-
const
|
|
941
|
+
const se_ImageResponseCard = (input, context) => {
|
|
962
942
|
return {
|
|
963
|
-
...(input.buttons != null && { buttons:
|
|
943
|
+
...(input.buttons != null && { buttons: se_ButtonsList(input.buttons, context) }),
|
|
964
944
|
...(input.imageUrl != null && { imageUrl: input.imageUrl }),
|
|
965
945
|
...(input.subtitle != null && { subtitle: input.subtitle }),
|
|
966
946
|
...(input.title != null && { title: input.title }),
|
|
967
947
|
};
|
|
968
948
|
};
|
|
969
|
-
const
|
|
949
|
+
const se_Intent = (input, context) => {
|
|
970
950
|
return {
|
|
971
951
|
...(input.confirmationState != null && { confirmationState: input.confirmationState }),
|
|
972
952
|
...(input.name != null && { name: input.name }),
|
|
973
|
-
...(input.slots != null && { slots:
|
|
953
|
+
...(input.slots != null && { slots: se_Slots(input.slots, context) }),
|
|
974
954
|
...(input.state != null && { state: input.state }),
|
|
975
955
|
};
|
|
976
956
|
};
|
|
977
|
-
const
|
|
957
|
+
const se_Message = (input, context) => {
|
|
978
958
|
return {
|
|
979
959
|
...(input.content != null && { content: input.content }),
|
|
980
960
|
...(input.contentType != null && { contentType: input.contentType }),
|
|
981
961
|
...(input.imageResponseCard != null && {
|
|
982
|
-
imageResponseCard:
|
|
962
|
+
imageResponseCard: se_ImageResponseCard(input.imageResponseCard, context),
|
|
983
963
|
}),
|
|
984
964
|
};
|
|
985
965
|
};
|
|
986
|
-
const
|
|
966
|
+
const se_Messages = (input, context) => {
|
|
987
967
|
return input
|
|
988
968
|
.filter((e) => e != null)
|
|
989
969
|
.map((entry) => {
|
|
990
|
-
return
|
|
970
|
+
return se_Message(entry, context);
|
|
991
971
|
});
|
|
992
972
|
};
|
|
993
|
-
const
|
|
973
|
+
const se_PlaybackCompletionEvent = (input, context) => {
|
|
994
974
|
return {
|
|
995
975
|
...(input.clientTimestampMillis != null && { clientTimestampMillis: input.clientTimestampMillis }),
|
|
996
976
|
...(input.eventId != null && { eventId: input.eventId }),
|
|
997
977
|
};
|
|
998
978
|
};
|
|
999
|
-
const
|
|
979
|
+
const se_RuntimeHintDetails = (input, context) => {
|
|
1000
980
|
return {
|
|
1001
981
|
...(input.runtimeHintValues != null && {
|
|
1002
|
-
runtimeHintValues:
|
|
1003
|
-
}),
|
|
1004
|
-
...(input.subSlotHints != null && {
|
|
1005
|
-
subSlotHints: serializeAws_restJson1SlotHintsSlotMap(input.subSlotHints, context),
|
|
982
|
+
runtimeHintValues: se_RuntimeHintValuesList(input.runtimeHintValues, context),
|
|
1006
983
|
}),
|
|
984
|
+
...(input.subSlotHints != null && { subSlotHints: se_SlotHintsSlotMap(input.subSlotHints, context) }),
|
|
1007
985
|
};
|
|
1008
986
|
};
|
|
1009
|
-
const
|
|
987
|
+
const se_RuntimeHints = (input, context) => {
|
|
1010
988
|
return {
|
|
1011
|
-
...(input.slotHints != null && { slotHints:
|
|
989
|
+
...(input.slotHints != null && { slotHints: se_SlotHintsIntentMap(input.slotHints, context) }),
|
|
1012
990
|
};
|
|
1013
991
|
};
|
|
1014
|
-
const
|
|
992
|
+
const se_RuntimeHintValue = (input, context) => {
|
|
1015
993
|
return {
|
|
1016
994
|
...(input.phrase != null && { phrase: input.phrase }),
|
|
1017
995
|
};
|
|
1018
996
|
};
|
|
1019
|
-
const
|
|
997
|
+
const se_RuntimeHintValuesList = (input, context) => {
|
|
1020
998
|
return input
|
|
1021
999
|
.filter((e) => e != null)
|
|
1022
1000
|
.map((entry) => {
|
|
1023
|
-
return
|
|
1001
|
+
return se_RuntimeHintValue(entry, context);
|
|
1024
1002
|
});
|
|
1025
1003
|
};
|
|
1026
|
-
const
|
|
1004
|
+
const se_SessionState = (input, context) => {
|
|
1027
1005
|
return {
|
|
1028
|
-
...(input.activeContexts != null && {
|
|
1029
|
-
|
|
1030
|
-
}),
|
|
1031
|
-
...(input.dialogAction != null && {
|
|
1032
|
-
dialogAction: serializeAws_restJson1DialogAction(input.dialogAction, context),
|
|
1033
|
-
}),
|
|
1034
|
-
...(input.intent != null && { intent: serializeAws_restJson1Intent(input.intent, context) }),
|
|
1006
|
+
...(input.activeContexts != null && { activeContexts: se_ActiveContextsList(input.activeContexts, context) }),
|
|
1007
|
+
...(input.dialogAction != null && { dialogAction: se_DialogAction(input.dialogAction, context) }),
|
|
1008
|
+
...(input.intent != null && { intent: se_Intent(input.intent, context) }),
|
|
1035
1009
|
...(input.originatingRequestId != null && { originatingRequestId: input.originatingRequestId }),
|
|
1036
|
-
...(input.runtimeHints != null && {
|
|
1037
|
-
|
|
1038
|
-
}),
|
|
1039
|
-
...(input.sessionAttributes != null && {
|
|
1040
|
-
sessionAttributes: serializeAws_restJson1StringMap(input.sessionAttributes, context),
|
|
1041
|
-
}),
|
|
1010
|
+
...(input.runtimeHints != null && { runtimeHints: se_RuntimeHints(input.runtimeHints, context) }),
|
|
1011
|
+
...(input.sessionAttributes != null && { sessionAttributes: se_StringMap(input.sessionAttributes, context) }),
|
|
1042
1012
|
};
|
|
1043
1013
|
};
|
|
1044
|
-
const
|
|
1014
|
+
const se_Slot = (input, context) => {
|
|
1045
1015
|
return {
|
|
1046
1016
|
...(input.shape != null && { shape: input.shape }),
|
|
1047
|
-
...(input.subSlots != null && { subSlots:
|
|
1048
|
-
...(input.value != null && { value:
|
|
1049
|
-
...(input.values != null && { values:
|
|
1017
|
+
...(input.subSlots != null && { subSlots: se_Slots(input.subSlots, context) }),
|
|
1018
|
+
...(input.value != null && { value: se_Value(input.value, context) }),
|
|
1019
|
+
...(input.values != null && { values: se_Values(input.values, context) }),
|
|
1050
1020
|
};
|
|
1051
1021
|
};
|
|
1052
|
-
const
|
|
1022
|
+
const se_SlotHintsIntentMap = (input, context) => {
|
|
1053
1023
|
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
1054
1024
|
if (value === null) {
|
|
1055
1025
|
return acc;
|
|
1056
1026
|
}
|
|
1057
|
-
acc[key] =
|
|
1027
|
+
acc[key] = se_SlotHintsSlotMap(value, context);
|
|
1058
1028
|
return acc;
|
|
1059
1029
|
}, {});
|
|
1060
1030
|
};
|
|
1061
|
-
const
|
|
1031
|
+
const se_SlotHintsSlotMap = (input, context) => {
|
|
1062
1032
|
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
1063
1033
|
if (value === null) {
|
|
1064
1034
|
return acc;
|
|
1065
1035
|
}
|
|
1066
|
-
acc[key] =
|
|
1036
|
+
acc[key] = se_RuntimeHintDetails(value, context);
|
|
1067
1037
|
return acc;
|
|
1068
1038
|
}, {});
|
|
1069
1039
|
};
|
|
1070
|
-
const
|
|
1040
|
+
const se_Slots = (input, context) => {
|
|
1071
1041
|
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
1072
1042
|
if (value === null) {
|
|
1073
1043
|
return acc;
|
|
1074
1044
|
}
|
|
1075
|
-
acc[key] =
|
|
1045
|
+
acc[key] = se_Slot(value, context);
|
|
1076
1046
|
return acc;
|
|
1077
1047
|
}, {});
|
|
1078
1048
|
};
|
|
1079
|
-
const
|
|
1049
|
+
const se_StringList = (input, context) => {
|
|
1080
1050
|
return input
|
|
1081
1051
|
.filter((e) => e != null)
|
|
1082
1052
|
.map((entry) => {
|
|
1083
1053
|
return entry;
|
|
1084
1054
|
});
|
|
1085
1055
|
};
|
|
1086
|
-
const
|
|
1056
|
+
const se_StringMap = (input, context) => {
|
|
1087
1057
|
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
1088
1058
|
if (value === null) {
|
|
1089
1059
|
return acc;
|
|
@@ -1092,41 +1062,35 @@ const serializeAws_restJson1StringMap = (input, context) => {
|
|
|
1092
1062
|
return acc;
|
|
1093
1063
|
}, {});
|
|
1094
1064
|
};
|
|
1095
|
-
const
|
|
1065
|
+
const se_TextInputEvent = (input, context) => {
|
|
1096
1066
|
return {
|
|
1097
1067
|
...(input.clientTimestampMillis != null && { clientTimestampMillis: input.clientTimestampMillis }),
|
|
1098
1068
|
...(input.eventId != null && { eventId: input.eventId }),
|
|
1099
1069
|
...(input.text != null && { text: input.text }),
|
|
1100
1070
|
};
|
|
1101
1071
|
};
|
|
1102
|
-
const
|
|
1072
|
+
const se_Value = (input, context) => {
|
|
1103
1073
|
return {
|
|
1104
1074
|
...(input.interpretedValue != null && { interpretedValue: input.interpretedValue }),
|
|
1105
1075
|
...(input.originalValue != null && { originalValue: input.originalValue }),
|
|
1106
|
-
...(input.resolvedValues != null && {
|
|
1107
|
-
resolvedValues: serializeAws_restJson1StringList(input.resolvedValues, context),
|
|
1108
|
-
}),
|
|
1076
|
+
...(input.resolvedValues != null && { resolvedValues: se_StringList(input.resolvedValues, context) }),
|
|
1109
1077
|
};
|
|
1110
1078
|
};
|
|
1111
|
-
const
|
|
1079
|
+
const se_Values = (input, context) => {
|
|
1112
1080
|
return input
|
|
1113
1081
|
.filter((e) => e != null)
|
|
1114
1082
|
.map((entry) => {
|
|
1115
|
-
return
|
|
1083
|
+
return se_Slot(entry, context);
|
|
1116
1084
|
});
|
|
1117
1085
|
};
|
|
1118
|
-
const
|
|
1086
|
+
const de_ActiveContext = (output, context) => {
|
|
1119
1087
|
return {
|
|
1120
|
-
contextAttributes: output.contextAttributes != null
|
|
1121
|
-
? deserializeAws_restJson1ActiveContextParametersMap(output.contextAttributes, context)
|
|
1122
|
-
: undefined,
|
|
1088
|
+
contextAttributes: output.contextAttributes != null ? de_ActiveContextParametersMap(output.contextAttributes, context) : undefined,
|
|
1123
1089
|
name: (0, smithy_client_1.expectString)(output.name),
|
|
1124
|
-
timeToLive: output.timeToLive != null
|
|
1125
|
-
? deserializeAws_restJson1ActiveContextTimeToLive(output.timeToLive, context)
|
|
1126
|
-
: undefined,
|
|
1090
|
+
timeToLive: output.timeToLive != null ? de_ActiveContextTimeToLive(output.timeToLive, context) : undefined,
|
|
1127
1091
|
};
|
|
1128
1092
|
};
|
|
1129
|
-
const
|
|
1093
|
+
const de_ActiveContextParametersMap = (output, context) => {
|
|
1130
1094
|
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
1131
1095
|
if (value === null) {
|
|
1132
1096
|
return acc;
|
|
@@ -1135,199 +1099,181 @@ const deserializeAws_restJson1ActiveContextParametersMap = (output, context) =>
|
|
|
1135
1099
|
return acc;
|
|
1136
1100
|
}, {});
|
|
1137
1101
|
};
|
|
1138
|
-
const
|
|
1102
|
+
const de_ActiveContextsList = (output, context) => {
|
|
1139
1103
|
const retVal = (output || [])
|
|
1140
1104
|
.filter((e) => e != null)
|
|
1141
1105
|
.map((entry) => {
|
|
1142
1106
|
if (entry === null) {
|
|
1143
1107
|
return null;
|
|
1144
1108
|
}
|
|
1145
|
-
return
|
|
1109
|
+
return de_ActiveContext(entry, context);
|
|
1146
1110
|
});
|
|
1147
1111
|
return retVal;
|
|
1148
1112
|
};
|
|
1149
|
-
const
|
|
1113
|
+
const de_ActiveContextTimeToLive = (output, context) => {
|
|
1150
1114
|
return {
|
|
1151
1115
|
timeToLiveInSeconds: (0, smithy_client_1.expectInt32)(output.timeToLiveInSeconds),
|
|
1152
1116
|
turnsToLive: (0, smithy_client_1.expectInt32)(output.turnsToLive),
|
|
1153
1117
|
};
|
|
1154
1118
|
};
|
|
1155
|
-
const
|
|
1119
|
+
const de_AudioResponseEvent = (output, context) => {
|
|
1156
1120
|
return {
|
|
1157
1121
|
audioChunk: output.audioChunk != null ? context.base64Decoder(output.audioChunk) : undefined,
|
|
1158
1122
|
contentType: (0, smithy_client_1.expectString)(output.contentType),
|
|
1159
1123
|
eventId: (0, smithy_client_1.expectString)(output.eventId),
|
|
1160
1124
|
};
|
|
1161
1125
|
};
|
|
1162
|
-
const
|
|
1126
|
+
const de_Button = (output, context) => {
|
|
1163
1127
|
return {
|
|
1164
1128
|
text: (0, smithy_client_1.expectString)(output.text),
|
|
1165
1129
|
value: (0, smithy_client_1.expectString)(output.value),
|
|
1166
1130
|
};
|
|
1167
1131
|
};
|
|
1168
|
-
const
|
|
1132
|
+
const de_ButtonsList = (output, context) => {
|
|
1169
1133
|
const retVal = (output || [])
|
|
1170
1134
|
.filter((e) => e != null)
|
|
1171
1135
|
.map((entry) => {
|
|
1172
1136
|
if (entry === null) {
|
|
1173
1137
|
return null;
|
|
1174
1138
|
}
|
|
1175
|
-
return
|
|
1139
|
+
return de_Button(entry, context);
|
|
1176
1140
|
});
|
|
1177
1141
|
return retVal;
|
|
1178
1142
|
};
|
|
1179
|
-
const
|
|
1143
|
+
const de_ConfidenceScore = (output, context) => {
|
|
1180
1144
|
return {
|
|
1181
1145
|
score: (0, smithy_client_1.limitedParseDouble)(output.score),
|
|
1182
1146
|
};
|
|
1183
1147
|
};
|
|
1184
|
-
const
|
|
1148
|
+
const de_DialogAction = (output, context) => {
|
|
1185
1149
|
return {
|
|
1186
1150
|
slotElicitationStyle: (0, smithy_client_1.expectString)(output.slotElicitationStyle),
|
|
1187
1151
|
slotToElicit: (0, smithy_client_1.expectString)(output.slotToElicit),
|
|
1188
|
-
subSlotToElicit: output.subSlotToElicit != null
|
|
1189
|
-
? deserializeAws_restJson1ElicitSubSlot(output.subSlotToElicit, context)
|
|
1190
|
-
: undefined,
|
|
1152
|
+
subSlotToElicit: output.subSlotToElicit != null ? de_ElicitSubSlot(output.subSlotToElicit, context) : undefined,
|
|
1191
1153
|
type: (0, smithy_client_1.expectString)(output.type),
|
|
1192
1154
|
};
|
|
1193
1155
|
};
|
|
1194
|
-
const
|
|
1156
|
+
const de_ElicitSubSlot = (output, context) => {
|
|
1195
1157
|
return {
|
|
1196
1158
|
name: (0, smithy_client_1.expectString)(output.name),
|
|
1197
|
-
subSlotToElicit: output.subSlotToElicit != null
|
|
1198
|
-
? deserializeAws_restJson1ElicitSubSlot(output.subSlotToElicit, context)
|
|
1199
|
-
: undefined,
|
|
1159
|
+
subSlotToElicit: output.subSlotToElicit != null ? de_ElicitSubSlot(output.subSlotToElicit, context) : undefined,
|
|
1200
1160
|
};
|
|
1201
1161
|
};
|
|
1202
|
-
const
|
|
1162
|
+
const de_HeartbeatEvent = (output, context) => {
|
|
1203
1163
|
return {
|
|
1204
1164
|
eventId: (0, smithy_client_1.expectString)(output.eventId),
|
|
1205
1165
|
};
|
|
1206
1166
|
};
|
|
1207
|
-
const
|
|
1167
|
+
const de_ImageResponseCard = (output, context) => {
|
|
1208
1168
|
return {
|
|
1209
|
-
buttons: output.buttons != null ?
|
|
1169
|
+
buttons: output.buttons != null ? de_ButtonsList(output.buttons, context) : undefined,
|
|
1210
1170
|
imageUrl: (0, smithy_client_1.expectString)(output.imageUrl),
|
|
1211
1171
|
subtitle: (0, smithy_client_1.expectString)(output.subtitle),
|
|
1212
1172
|
title: (0, smithy_client_1.expectString)(output.title),
|
|
1213
1173
|
};
|
|
1214
1174
|
};
|
|
1215
|
-
const
|
|
1175
|
+
const de_Intent = (output, context) => {
|
|
1216
1176
|
return {
|
|
1217
1177
|
confirmationState: (0, smithy_client_1.expectString)(output.confirmationState),
|
|
1218
1178
|
name: (0, smithy_client_1.expectString)(output.name),
|
|
1219
|
-
slots: output.slots != null ?
|
|
1179
|
+
slots: output.slots != null ? de_Slots(output.slots, context) : undefined,
|
|
1220
1180
|
state: (0, smithy_client_1.expectString)(output.state),
|
|
1221
1181
|
};
|
|
1222
1182
|
};
|
|
1223
|
-
const
|
|
1183
|
+
const de_IntentResultEvent = (output, context) => {
|
|
1224
1184
|
return {
|
|
1225
1185
|
eventId: (0, smithy_client_1.expectString)(output.eventId),
|
|
1226
1186
|
inputMode: (0, smithy_client_1.expectString)(output.inputMode),
|
|
1227
|
-
interpretations: output.interpretations != null
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
recognizedBotMember: output.recognizedBotMember != null
|
|
1231
|
-
? deserializeAws_restJson1RecognizedBotMember(output.recognizedBotMember, context)
|
|
1232
|
-
: undefined,
|
|
1233
|
-
requestAttributes: output.requestAttributes != null
|
|
1234
|
-
? deserializeAws_restJson1StringMap(output.requestAttributes, context)
|
|
1235
|
-
: undefined,
|
|
1187
|
+
interpretations: output.interpretations != null ? de_Interpretations(output.interpretations, context) : undefined,
|
|
1188
|
+
recognizedBotMember: output.recognizedBotMember != null ? de_RecognizedBotMember(output.recognizedBotMember, context) : undefined,
|
|
1189
|
+
requestAttributes: output.requestAttributes != null ? de_StringMap(output.requestAttributes, context) : undefined,
|
|
1236
1190
|
sessionId: (0, smithy_client_1.expectString)(output.sessionId),
|
|
1237
|
-
sessionState: output.sessionState != null ?
|
|
1191
|
+
sessionState: output.sessionState != null ? de_SessionState(output.sessionState, context) : undefined,
|
|
1238
1192
|
};
|
|
1239
1193
|
};
|
|
1240
|
-
const
|
|
1194
|
+
const de_Interpretation = (output, context) => {
|
|
1241
1195
|
return {
|
|
1242
|
-
intent: output.intent != null ?
|
|
1243
|
-
nluConfidence: output.nluConfidence != null ?
|
|
1244
|
-
sentimentResponse: output.sentimentResponse != null
|
|
1245
|
-
? deserializeAws_restJson1SentimentResponse(output.sentimentResponse, context)
|
|
1246
|
-
: undefined,
|
|
1196
|
+
intent: output.intent != null ? de_Intent(output.intent, context) : undefined,
|
|
1197
|
+
nluConfidence: output.nluConfidence != null ? de_ConfidenceScore(output.nluConfidence, context) : undefined,
|
|
1198
|
+
sentimentResponse: output.sentimentResponse != null ? de_SentimentResponse(output.sentimentResponse, context) : undefined,
|
|
1247
1199
|
};
|
|
1248
1200
|
};
|
|
1249
|
-
const
|
|
1201
|
+
const de_Interpretations = (output, context) => {
|
|
1250
1202
|
const retVal = (output || [])
|
|
1251
1203
|
.filter((e) => e != null)
|
|
1252
1204
|
.map((entry) => {
|
|
1253
1205
|
if (entry === null) {
|
|
1254
1206
|
return null;
|
|
1255
1207
|
}
|
|
1256
|
-
return
|
|
1208
|
+
return de_Interpretation(entry, context);
|
|
1257
1209
|
});
|
|
1258
1210
|
return retVal;
|
|
1259
1211
|
};
|
|
1260
|
-
const
|
|
1212
|
+
const de_Message = (output, context) => {
|
|
1261
1213
|
return {
|
|
1262
1214
|
content: (0, smithy_client_1.expectString)(output.content),
|
|
1263
1215
|
contentType: (0, smithy_client_1.expectString)(output.contentType),
|
|
1264
|
-
imageResponseCard: output.imageResponseCard != null
|
|
1265
|
-
? deserializeAws_restJson1ImageResponseCard(output.imageResponseCard, context)
|
|
1266
|
-
: undefined,
|
|
1216
|
+
imageResponseCard: output.imageResponseCard != null ? de_ImageResponseCard(output.imageResponseCard, context) : undefined,
|
|
1267
1217
|
};
|
|
1268
1218
|
};
|
|
1269
|
-
const
|
|
1219
|
+
const de_Messages = (output, context) => {
|
|
1270
1220
|
const retVal = (output || [])
|
|
1271
1221
|
.filter((e) => e != null)
|
|
1272
1222
|
.map((entry) => {
|
|
1273
1223
|
if (entry === null) {
|
|
1274
1224
|
return null;
|
|
1275
1225
|
}
|
|
1276
|
-
return
|
|
1226
|
+
return de_Message(entry, context);
|
|
1277
1227
|
});
|
|
1278
1228
|
return retVal;
|
|
1279
1229
|
};
|
|
1280
|
-
const
|
|
1230
|
+
const de_PlaybackInterruptionEvent = (output, context) => {
|
|
1281
1231
|
return {
|
|
1282
1232
|
causedByEventId: (0, smithy_client_1.expectString)(output.causedByEventId),
|
|
1283
1233
|
eventId: (0, smithy_client_1.expectString)(output.eventId),
|
|
1284
1234
|
eventReason: (0, smithy_client_1.expectString)(output.eventReason),
|
|
1285
1235
|
};
|
|
1286
1236
|
};
|
|
1287
|
-
const
|
|
1237
|
+
const de_RecognizedBotMember = (output, context) => {
|
|
1288
1238
|
return {
|
|
1289
1239
|
botId: (0, smithy_client_1.expectString)(output.botId),
|
|
1290
1240
|
botName: (0, smithy_client_1.expectString)(output.botName),
|
|
1291
1241
|
};
|
|
1292
1242
|
};
|
|
1293
|
-
const
|
|
1243
|
+
const de_RuntimeHintDetails = (output, context) => {
|
|
1294
1244
|
return {
|
|
1295
|
-
runtimeHintValues: output.runtimeHintValues != null
|
|
1296
|
-
|
|
1297
|
-
: undefined,
|
|
1298
|
-
subSlotHints: output.subSlotHints != null ? deserializeAws_restJson1SlotHintsSlotMap(output.subSlotHints, context) : undefined,
|
|
1245
|
+
runtimeHintValues: output.runtimeHintValues != null ? de_RuntimeHintValuesList(output.runtimeHintValues, context) : undefined,
|
|
1246
|
+
subSlotHints: output.subSlotHints != null ? de_SlotHintsSlotMap(output.subSlotHints, context) : undefined,
|
|
1299
1247
|
};
|
|
1300
1248
|
};
|
|
1301
|
-
const
|
|
1249
|
+
const de_RuntimeHints = (output, context) => {
|
|
1302
1250
|
return {
|
|
1303
|
-
slotHints: output.slotHints != null ?
|
|
1251
|
+
slotHints: output.slotHints != null ? de_SlotHintsIntentMap(output.slotHints, context) : undefined,
|
|
1304
1252
|
};
|
|
1305
1253
|
};
|
|
1306
|
-
const
|
|
1254
|
+
const de_RuntimeHintValue = (output, context) => {
|
|
1307
1255
|
return {
|
|
1308
1256
|
phrase: (0, smithy_client_1.expectString)(output.phrase),
|
|
1309
1257
|
};
|
|
1310
1258
|
};
|
|
1311
|
-
const
|
|
1259
|
+
const de_RuntimeHintValuesList = (output, context) => {
|
|
1312
1260
|
const retVal = (output || [])
|
|
1313
1261
|
.filter((e) => e != null)
|
|
1314
1262
|
.map((entry) => {
|
|
1315
1263
|
if (entry === null) {
|
|
1316
1264
|
return null;
|
|
1317
1265
|
}
|
|
1318
|
-
return
|
|
1266
|
+
return de_RuntimeHintValue(entry, context);
|
|
1319
1267
|
});
|
|
1320
1268
|
return retVal;
|
|
1321
1269
|
};
|
|
1322
|
-
const
|
|
1270
|
+
const de_SentimentResponse = (output, context) => {
|
|
1323
1271
|
return {
|
|
1324
1272
|
sentiment: (0, smithy_client_1.expectString)(output.sentiment),
|
|
1325
|
-
sentimentScore: output.sentimentScore != null
|
|
1326
|
-
? deserializeAws_restJson1SentimentScore(output.sentimentScore, context)
|
|
1327
|
-
: undefined,
|
|
1273
|
+
sentimentScore: output.sentimentScore != null ? de_SentimentScore(output.sentimentScore, context) : undefined,
|
|
1328
1274
|
};
|
|
1329
1275
|
};
|
|
1330
|
-
const
|
|
1276
|
+
const de_SentimentScore = (output, context) => {
|
|
1331
1277
|
return {
|
|
1332
1278
|
mixed: (0, smithy_client_1.limitedParseDouble)(output.mixed),
|
|
1333
1279
|
negative: (0, smithy_client_1.limitedParseDouble)(output.negative),
|
|
@@ -1335,56 +1281,52 @@ const deserializeAws_restJson1SentimentScore = (output, context) => {
|
|
|
1335
1281
|
positive: (0, smithy_client_1.limitedParseDouble)(output.positive),
|
|
1336
1282
|
};
|
|
1337
1283
|
};
|
|
1338
|
-
const
|
|
1284
|
+
const de_SessionState = (output, context) => {
|
|
1339
1285
|
return {
|
|
1340
|
-
activeContexts: output.activeContexts != null
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
dialogAction: output.dialogAction != null ? deserializeAws_restJson1DialogAction(output.dialogAction, context) : undefined,
|
|
1344
|
-
intent: output.intent != null ? deserializeAws_restJson1Intent(output.intent, context) : undefined,
|
|
1286
|
+
activeContexts: output.activeContexts != null ? de_ActiveContextsList(output.activeContexts, context) : undefined,
|
|
1287
|
+
dialogAction: output.dialogAction != null ? de_DialogAction(output.dialogAction, context) : undefined,
|
|
1288
|
+
intent: output.intent != null ? de_Intent(output.intent, context) : undefined,
|
|
1345
1289
|
originatingRequestId: (0, smithy_client_1.expectString)(output.originatingRequestId),
|
|
1346
|
-
runtimeHints: output.runtimeHints != null ?
|
|
1347
|
-
sessionAttributes: output.sessionAttributes != null
|
|
1348
|
-
? deserializeAws_restJson1StringMap(output.sessionAttributes, context)
|
|
1349
|
-
: undefined,
|
|
1290
|
+
runtimeHints: output.runtimeHints != null ? de_RuntimeHints(output.runtimeHints, context) : undefined,
|
|
1291
|
+
sessionAttributes: output.sessionAttributes != null ? de_StringMap(output.sessionAttributes, context) : undefined,
|
|
1350
1292
|
};
|
|
1351
1293
|
};
|
|
1352
|
-
const
|
|
1294
|
+
const de_Slot = (output, context) => {
|
|
1353
1295
|
return {
|
|
1354
1296
|
shape: (0, smithy_client_1.expectString)(output.shape),
|
|
1355
|
-
subSlots: output.subSlots != null ?
|
|
1356
|
-
value: output.value != null ?
|
|
1357
|
-
values: output.values != null ?
|
|
1297
|
+
subSlots: output.subSlots != null ? de_Slots(output.subSlots, context) : undefined,
|
|
1298
|
+
value: output.value != null ? de_Value(output.value, context) : undefined,
|
|
1299
|
+
values: output.values != null ? de_Values(output.values, context) : undefined,
|
|
1358
1300
|
};
|
|
1359
1301
|
};
|
|
1360
|
-
const
|
|
1302
|
+
const de_SlotHintsIntentMap = (output, context) => {
|
|
1361
1303
|
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
1362
1304
|
if (value === null) {
|
|
1363
1305
|
return acc;
|
|
1364
1306
|
}
|
|
1365
|
-
acc[key] =
|
|
1307
|
+
acc[key] = de_SlotHintsSlotMap(value, context);
|
|
1366
1308
|
return acc;
|
|
1367
1309
|
}, {});
|
|
1368
1310
|
};
|
|
1369
|
-
const
|
|
1311
|
+
const de_SlotHintsSlotMap = (output, context) => {
|
|
1370
1312
|
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
1371
1313
|
if (value === null) {
|
|
1372
1314
|
return acc;
|
|
1373
1315
|
}
|
|
1374
|
-
acc[key] =
|
|
1316
|
+
acc[key] = de_RuntimeHintDetails(value, context);
|
|
1375
1317
|
return acc;
|
|
1376
1318
|
}, {});
|
|
1377
1319
|
};
|
|
1378
|
-
const
|
|
1320
|
+
const de_Slots = (output, context) => {
|
|
1379
1321
|
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
1380
1322
|
if (value === null) {
|
|
1381
1323
|
return acc;
|
|
1382
1324
|
}
|
|
1383
|
-
acc[key] =
|
|
1325
|
+
acc[key] = de_Slot(value, context);
|
|
1384
1326
|
return acc;
|
|
1385
1327
|
}, {});
|
|
1386
1328
|
};
|
|
1387
|
-
const
|
|
1329
|
+
const de_StringList = (output, context) => {
|
|
1388
1330
|
const retVal = (output || [])
|
|
1389
1331
|
.filter((e) => e != null)
|
|
1390
1332
|
.map((entry) => {
|
|
@@ -1395,7 +1337,7 @@ const deserializeAws_restJson1StringList = (output, context) => {
|
|
|
1395
1337
|
});
|
|
1396
1338
|
return retVal;
|
|
1397
1339
|
};
|
|
1398
|
-
const
|
|
1340
|
+
const de_StringMap = (output, context) => {
|
|
1399
1341
|
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
1400
1342
|
if (value === null) {
|
|
1401
1343
|
return acc;
|
|
@@ -1404,33 +1346,33 @@ const deserializeAws_restJson1StringMap = (output, context) => {
|
|
|
1404
1346
|
return acc;
|
|
1405
1347
|
}, {});
|
|
1406
1348
|
};
|
|
1407
|
-
const
|
|
1349
|
+
const de_TextResponseEvent = (output, context) => {
|
|
1408
1350
|
return {
|
|
1409
1351
|
eventId: (0, smithy_client_1.expectString)(output.eventId),
|
|
1410
|
-
messages: output.messages != null ?
|
|
1352
|
+
messages: output.messages != null ? de_Messages(output.messages, context) : undefined,
|
|
1411
1353
|
};
|
|
1412
1354
|
};
|
|
1413
|
-
const
|
|
1355
|
+
const de_TranscriptEvent = (output, context) => {
|
|
1414
1356
|
return {
|
|
1415
1357
|
eventId: (0, smithy_client_1.expectString)(output.eventId),
|
|
1416
1358
|
transcript: (0, smithy_client_1.expectString)(output.transcript),
|
|
1417
1359
|
};
|
|
1418
1360
|
};
|
|
1419
|
-
const
|
|
1361
|
+
const de_Value = (output, context) => {
|
|
1420
1362
|
return {
|
|
1421
1363
|
interpretedValue: (0, smithy_client_1.expectString)(output.interpretedValue),
|
|
1422
1364
|
originalValue: (0, smithy_client_1.expectString)(output.originalValue),
|
|
1423
|
-
resolvedValues: output.resolvedValues != null ?
|
|
1365
|
+
resolvedValues: output.resolvedValues != null ? de_StringList(output.resolvedValues, context) : undefined,
|
|
1424
1366
|
};
|
|
1425
1367
|
};
|
|
1426
|
-
const
|
|
1368
|
+
const de_Values = (output, context) => {
|
|
1427
1369
|
const retVal = (output || [])
|
|
1428
1370
|
.filter((e) => e != null)
|
|
1429
1371
|
.map((entry) => {
|
|
1430
1372
|
if (entry === null) {
|
|
1431
1373
|
return null;
|
|
1432
1374
|
}
|
|
1433
|
-
return
|
|
1375
|
+
return de_Slot(entry, context);
|
|
1434
1376
|
});
|
|
1435
1377
|
return retVal;
|
|
1436
1378
|
};
|