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