@aws-sdk/client-lex-runtime-service 3.131.0 → 3.142.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/CHANGELOG.md +33 -0
- package/README.md +1 -1
- package/dist-cjs/commands/DeleteSessionCommand.js +2 -2
- package/dist-cjs/commands/GetSessionCommand.js +2 -2
- package/dist-cjs/commands/PostContentCommand.js +2 -2
- package/dist-cjs/commands/PostTextCommand.js +2 -2
- package/dist-cjs/commands/PutSessionCommand.js +2 -2
- package/dist-cjs/models/models_0.js +119 -159
- package/dist-cjs/protocols/Aws_restJson1.js +177 -416
- package/dist-es/commands/DeleteSessionCommand.js +3 -3
- package/dist-es/commands/GetSessionCommand.js +3 -3
- package/dist-es/commands/PostContentCommand.js +3 -3
- package/dist-es/commands/PostTextCommand.js +3 -3
- package/dist-es/commands/PutSessionCommand.js +3 -3
- package/dist-es/models/models_0.js +26 -86
- package/dist-es/protocols/Aws_restJson1.js +216 -411
- package/dist-types/models/models_0.d.ts +80 -120
- package/dist-types/ts3.4/models/models_0.d.ts +0 -32
- package/package.json +6 -6
|
@@ -10,36 +10,9 @@ const serializeAws_restJson1DeleteSessionCommand = async (input, context) => {
|
|
|
10
10
|
const headers = {};
|
|
11
11
|
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
12
12
|
"/bot/{botName}/alias/{botAlias}/user/{userId}/session";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
throw new Error("Empty value provided for input HTTP label: botName.");
|
|
17
|
-
}
|
|
18
|
-
resolvedPath = resolvedPath.replace("{botName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
throw new Error("No value provided for input HTTP label: botName.");
|
|
22
|
-
}
|
|
23
|
-
if (input.botAlias !== undefined) {
|
|
24
|
-
const labelValue = input.botAlias;
|
|
25
|
-
if (labelValue.length <= 0) {
|
|
26
|
-
throw new Error("Empty value provided for input HTTP label: botAlias.");
|
|
27
|
-
}
|
|
28
|
-
resolvedPath = resolvedPath.replace("{botAlias}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
throw new Error("No value provided for input HTTP label: botAlias.");
|
|
32
|
-
}
|
|
33
|
-
if (input.userId !== undefined) {
|
|
34
|
-
const labelValue = input.userId;
|
|
35
|
-
if (labelValue.length <= 0) {
|
|
36
|
-
throw new Error("Empty value provided for input HTTP label: userId.");
|
|
37
|
-
}
|
|
38
|
-
resolvedPath = resolvedPath.replace("{userId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
throw new Error("No value provided for input HTTP label: userId.");
|
|
42
|
-
}
|
|
13
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "botName", () => input.botName, "{botName}", false);
|
|
14
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "botAlias", () => input.botAlias, "{botAlias}", false);
|
|
15
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "userId", () => input.userId, "{userId}", false);
|
|
43
16
|
let body;
|
|
44
17
|
return new protocol_http_1.HttpRequest({
|
|
45
18
|
protocol,
|
|
@@ -57,39 +30,12 @@ const serializeAws_restJson1GetSessionCommand = async (input, context) => {
|
|
|
57
30
|
const headers = {};
|
|
58
31
|
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
59
32
|
"/bot/{botName}/alias/{botAlias}/user/{userId}/session";
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
throw new Error("No value provided for input HTTP label: botName.");
|
|
69
|
-
}
|
|
70
|
-
if (input.botAlias !== undefined) {
|
|
71
|
-
const labelValue = input.botAlias;
|
|
72
|
-
if (labelValue.length <= 0) {
|
|
73
|
-
throw new Error("Empty value provided for input HTTP label: botAlias.");
|
|
74
|
-
}
|
|
75
|
-
resolvedPath = resolvedPath.replace("{botAlias}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
throw new Error("No value provided for input HTTP label: botAlias.");
|
|
79
|
-
}
|
|
80
|
-
if (input.userId !== undefined) {
|
|
81
|
-
const labelValue = input.userId;
|
|
82
|
-
if (labelValue.length <= 0) {
|
|
83
|
-
throw new Error("Empty value provided for input HTTP label: userId.");
|
|
84
|
-
}
|
|
85
|
-
resolvedPath = resolvedPath.replace("{userId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
throw new Error("No value provided for input HTTP label: userId.");
|
|
89
|
-
}
|
|
90
|
-
const query = {
|
|
91
|
-
...(input.checkpointLabelFilter !== undefined && { checkpointLabelFilter: input.checkpointLabelFilter }),
|
|
92
|
-
};
|
|
33
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "botName", () => input.botName, "{botName}", false);
|
|
34
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "botAlias", () => input.botAlias, "{botAlias}", false);
|
|
35
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "userId", () => input.userId, "{userId}", false);
|
|
36
|
+
const query = map({
|
|
37
|
+
checkpointLabelFilter: [, input.checkpointLabelFilter],
|
|
38
|
+
});
|
|
93
39
|
let body;
|
|
94
40
|
return new protocol_http_1.HttpRequest({
|
|
95
41
|
protocol,
|
|
@@ -105,53 +51,28 @@ const serializeAws_restJson1GetSessionCommand = async (input, context) => {
|
|
|
105
51
|
exports.serializeAws_restJson1GetSessionCommand = serializeAws_restJson1GetSessionCommand;
|
|
106
52
|
const serializeAws_restJson1PostContentCommand = async (input, context) => {
|
|
107
53
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
108
|
-
const headers = {
|
|
109
|
-
"content-type": "application/octet-stream",
|
|
54
|
+
const headers = map({}, isSerializableHeaderValue, {
|
|
110
55
|
"x-amz-content-sha256": "UNSIGNED-PAYLOAD",
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
56
|
+
"content-type": input.contentType || "application/octet-stream",
|
|
57
|
+
"x-amz-lex-session-attributes": [
|
|
58
|
+
() => isSerializableHeaderValue(input.sessionAttributes),
|
|
59
|
+
() => context.base64Encoder(Buffer.from(smithy_client_1.LazyJsonString.fromObject(input.sessionAttributes))),
|
|
60
|
+
],
|
|
61
|
+
"x-amz-lex-request-attributes": [
|
|
62
|
+
() => isSerializableHeaderValue(input.requestAttributes),
|
|
63
|
+
() => context.base64Encoder(Buffer.from(smithy_client_1.LazyJsonString.fromObject(input.requestAttributes))),
|
|
64
|
+
],
|
|
65
|
+
accept: input.accept,
|
|
66
|
+
"x-amz-lex-active-contexts": [
|
|
67
|
+
() => isSerializableHeaderValue(input.activeContexts),
|
|
68
|
+
() => context.base64Encoder(Buffer.from(smithy_client_1.LazyJsonString.fromObject(input.activeContexts))),
|
|
69
|
+
],
|
|
70
|
+
});
|
|
123
71
|
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
124
72
|
"/bot/{botName}/alias/{botAlias}/user/{userId}/content";
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
throw new Error("Empty value provided for input HTTP label: botName.");
|
|
129
|
-
}
|
|
130
|
-
resolvedPath = resolvedPath.replace("{botName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
throw new Error("No value provided for input HTTP label: botName.");
|
|
134
|
-
}
|
|
135
|
-
if (input.botAlias !== undefined) {
|
|
136
|
-
const labelValue = input.botAlias;
|
|
137
|
-
if (labelValue.length <= 0) {
|
|
138
|
-
throw new Error("Empty value provided for input HTTP label: botAlias.");
|
|
139
|
-
}
|
|
140
|
-
resolvedPath = resolvedPath.replace("{botAlias}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
throw new Error("No value provided for input HTTP label: botAlias.");
|
|
144
|
-
}
|
|
145
|
-
if (input.userId !== undefined) {
|
|
146
|
-
const labelValue = input.userId;
|
|
147
|
-
if (labelValue.length <= 0) {
|
|
148
|
-
throw new Error("Empty value provided for input HTTP label: userId.");
|
|
149
|
-
}
|
|
150
|
-
resolvedPath = resolvedPath.replace("{userId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
throw new Error("No value provided for input HTTP label: userId.");
|
|
154
|
-
}
|
|
73
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "botName", () => input.botName, "{botName}", false);
|
|
74
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "botAlias", () => input.botAlias, "{botAlias}", false);
|
|
75
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "userId", () => input.userId, "{userId}", false);
|
|
155
76
|
let body;
|
|
156
77
|
if (input.inputStream !== undefined) {
|
|
157
78
|
body = input.inputStream;
|
|
@@ -174,36 +95,9 @@ const serializeAws_restJson1PostTextCommand = async (input, context) => {
|
|
|
174
95
|
};
|
|
175
96
|
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
176
97
|
"/bot/{botName}/alias/{botAlias}/user/{userId}/text";
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
throw new Error("Empty value provided for input HTTP label: botName.");
|
|
181
|
-
}
|
|
182
|
-
resolvedPath = resolvedPath.replace("{botName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
183
|
-
}
|
|
184
|
-
else {
|
|
185
|
-
throw new Error("No value provided for input HTTP label: botName.");
|
|
186
|
-
}
|
|
187
|
-
if (input.botAlias !== undefined) {
|
|
188
|
-
const labelValue = input.botAlias;
|
|
189
|
-
if (labelValue.length <= 0) {
|
|
190
|
-
throw new Error("Empty value provided for input HTTP label: botAlias.");
|
|
191
|
-
}
|
|
192
|
-
resolvedPath = resolvedPath.replace("{botAlias}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
193
|
-
}
|
|
194
|
-
else {
|
|
195
|
-
throw new Error("No value provided for input HTTP label: botAlias.");
|
|
196
|
-
}
|
|
197
|
-
if (input.userId !== undefined) {
|
|
198
|
-
const labelValue = input.userId;
|
|
199
|
-
if (labelValue.length <= 0) {
|
|
200
|
-
throw new Error("Empty value provided for input HTTP label: userId.");
|
|
201
|
-
}
|
|
202
|
-
resolvedPath = resolvedPath.replace("{userId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
203
|
-
}
|
|
204
|
-
else {
|
|
205
|
-
throw new Error("No value provided for input HTTP label: userId.");
|
|
206
|
-
}
|
|
98
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "botName", () => input.botName, "{botName}", false);
|
|
99
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "botAlias", () => input.botAlias, "{botAlias}", false);
|
|
100
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "userId", () => input.userId, "{userId}", false);
|
|
207
101
|
let body;
|
|
208
102
|
body = JSON.stringify({
|
|
209
103
|
...(input.activeContexts != null && {
|
|
@@ -230,42 +124,15 @@ const serializeAws_restJson1PostTextCommand = async (input, context) => {
|
|
|
230
124
|
exports.serializeAws_restJson1PostTextCommand = serializeAws_restJson1PostTextCommand;
|
|
231
125
|
const serializeAws_restJson1PutSessionCommand = async (input, context) => {
|
|
232
126
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
233
|
-
const headers = {
|
|
127
|
+
const headers = map({}, isSerializableHeaderValue, {
|
|
234
128
|
"content-type": "application/json",
|
|
235
|
-
|
|
236
|
-
};
|
|
129
|
+
accept: input.accept,
|
|
130
|
+
});
|
|
237
131
|
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
238
132
|
"/bot/{botName}/alias/{botAlias}/user/{userId}/session";
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
throw new Error("Empty value provided for input HTTP label: botName.");
|
|
243
|
-
}
|
|
244
|
-
resolvedPath = resolvedPath.replace("{botName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
245
|
-
}
|
|
246
|
-
else {
|
|
247
|
-
throw new Error("No value provided for input HTTP label: botName.");
|
|
248
|
-
}
|
|
249
|
-
if (input.botAlias !== undefined) {
|
|
250
|
-
const labelValue = input.botAlias;
|
|
251
|
-
if (labelValue.length <= 0) {
|
|
252
|
-
throw new Error("Empty value provided for input HTTP label: botAlias.");
|
|
253
|
-
}
|
|
254
|
-
resolvedPath = resolvedPath.replace("{botAlias}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
255
|
-
}
|
|
256
|
-
else {
|
|
257
|
-
throw new Error("No value provided for input HTTP label: botAlias.");
|
|
258
|
-
}
|
|
259
|
-
if (input.userId !== undefined) {
|
|
260
|
-
const labelValue = input.userId;
|
|
261
|
-
if (labelValue.length <= 0) {
|
|
262
|
-
throw new Error("Empty value provided for input HTTP label: userId.");
|
|
263
|
-
}
|
|
264
|
-
resolvedPath = resolvedPath.replace("{userId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
|
|
265
|
-
}
|
|
266
|
-
else {
|
|
267
|
-
throw new Error("No value provided for input HTTP label: userId.");
|
|
268
|
-
}
|
|
133
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "botName", () => input.botName, "{botName}", false);
|
|
134
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "botAlias", () => input.botAlias, "{botAlias}", false);
|
|
135
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "userId", () => input.userId, "{userId}", false);
|
|
269
136
|
let body;
|
|
270
137
|
body = JSON.stringify({
|
|
271
138
|
...(input.activeContexts != null && {
|
|
@@ -296,27 +163,23 @@ const deserializeAws_restJson1DeleteSessionCommand = async (output, context) =>
|
|
|
296
163
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
297
164
|
return deserializeAws_restJson1DeleteSessionCommandError(output, context);
|
|
298
165
|
}
|
|
299
|
-
const contents = {
|
|
166
|
+
const contents = map({
|
|
300
167
|
$metadata: deserializeMetadata(output),
|
|
301
|
-
|
|
302
|
-
botName: undefined,
|
|
303
|
-
sessionId: undefined,
|
|
304
|
-
userId: undefined,
|
|
305
|
-
};
|
|
168
|
+
});
|
|
306
169
|
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
307
|
-
if (data.botAlias
|
|
170
|
+
if (data.botAlias != null) {
|
|
308
171
|
contents.botAlias = (0, smithy_client_1.expectString)(data.botAlias);
|
|
309
172
|
}
|
|
310
|
-
if (data.botName
|
|
173
|
+
if (data.botName != null) {
|
|
311
174
|
contents.botName = (0, smithy_client_1.expectString)(data.botName);
|
|
312
175
|
}
|
|
313
|
-
if (data.sessionId
|
|
176
|
+
if (data.sessionId != null) {
|
|
314
177
|
contents.sessionId = (0, smithy_client_1.expectString)(data.sessionId);
|
|
315
178
|
}
|
|
316
|
-
if (data.userId
|
|
179
|
+
if (data.userId != null) {
|
|
317
180
|
contents.userId = (0, smithy_client_1.expectString)(data.userId);
|
|
318
181
|
}
|
|
319
|
-
return
|
|
182
|
+
return contents;
|
|
320
183
|
};
|
|
321
184
|
exports.deserializeAws_restJson1DeleteSessionCommand = deserializeAws_restJson1DeleteSessionCommand;
|
|
322
185
|
const deserializeAws_restJson1DeleteSessionCommandError = async (output, context) => {
|
|
@@ -324,7 +187,6 @@ const deserializeAws_restJson1DeleteSessionCommandError = async (output, context
|
|
|
324
187
|
...output,
|
|
325
188
|
body: await parseBody(output.body, context),
|
|
326
189
|
};
|
|
327
|
-
let response;
|
|
328
190
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
329
191
|
switch (errorCode) {
|
|
330
192
|
case "BadRequestException":
|
|
@@ -344,45 +206,38 @@ const deserializeAws_restJson1DeleteSessionCommandError = async (output, context
|
|
|
344
206
|
throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
|
|
345
207
|
default:
|
|
346
208
|
const parsedBody = parsedOutput.body;
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
$metadata,
|
|
209
|
+
(0, smithy_client_1.throwDefaultError)({
|
|
210
|
+
output,
|
|
211
|
+
parsedBody,
|
|
212
|
+
exceptionCtor: LexRuntimeServiceServiceException_1.LexRuntimeServiceServiceException,
|
|
213
|
+
errorCode,
|
|
353
214
|
});
|
|
354
|
-
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
355
215
|
}
|
|
356
216
|
};
|
|
357
217
|
const deserializeAws_restJson1GetSessionCommand = async (output, context) => {
|
|
358
218
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
359
219
|
return deserializeAws_restJson1GetSessionCommandError(output, context);
|
|
360
220
|
}
|
|
361
|
-
const contents = {
|
|
221
|
+
const contents = map({
|
|
362
222
|
$metadata: deserializeMetadata(output),
|
|
363
|
-
|
|
364
|
-
dialogAction: undefined,
|
|
365
|
-
recentIntentSummaryView: undefined,
|
|
366
|
-
sessionAttributes: undefined,
|
|
367
|
-
sessionId: undefined,
|
|
368
|
-
};
|
|
223
|
+
});
|
|
369
224
|
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
370
|
-
if (data.activeContexts
|
|
225
|
+
if (data.activeContexts != null) {
|
|
371
226
|
contents.activeContexts = deserializeAws_restJson1ActiveContextsList(data.activeContexts, context);
|
|
372
227
|
}
|
|
373
|
-
if (data.dialogAction
|
|
228
|
+
if (data.dialogAction != null) {
|
|
374
229
|
contents.dialogAction = deserializeAws_restJson1DialogAction(data.dialogAction, context);
|
|
375
230
|
}
|
|
376
|
-
if (data.recentIntentSummaryView
|
|
231
|
+
if (data.recentIntentSummaryView != null) {
|
|
377
232
|
contents.recentIntentSummaryView = deserializeAws_restJson1IntentSummaryList(data.recentIntentSummaryView, context);
|
|
378
233
|
}
|
|
379
|
-
if (data.sessionAttributes
|
|
234
|
+
if (data.sessionAttributes != null) {
|
|
380
235
|
contents.sessionAttributes = deserializeAws_restJson1StringMap(data.sessionAttributes, context);
|
|
381
236
|
}
|
|
382
|
-
if (data.sessionId
|
|
237
|
+
if (data.sessionId != null) {
|
|
383
238
|
contents.sessionId = (0, smithy_client_1.expectString)(data.sessionId);
|
|
384
239
|
}
|
|
385
|
-
return
|
|
240
|
+
return contents;
|
|
386
241
|
};
|
|
387
242
|
exports.deserializeAws_restJson1GetSessionCommand = deserializeAws_restJson1GetSessionCommand;
|
|
388
243
|
const deserializeAws_restJson1GetSessionCommandError = async (output, context) => {
|
|
@@ -390,7 +245,6 @@ const deserializeAws_restJson1GetSessionCommandError = async (output, context) =
|
|
|
390
245
|
...output,
|
|
391
246
|
body: await parseBody(output.body, context),
|
|
392
247
|
};
|
|
393
|
-
let response;
|
|
394
248
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
395
249
|
switch (errorCode) {
|
|
396
250
|
case "BadRequestException":
|
|
@@ -407,95 +261,56 @@ const deserializeAws_restJson1GetSessionCommandError = async (output, context) =
|
|
|
407
261
|
throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
|
|
408
262
|
default:
|
|
409
263
|
const parsedBody = parsedOutput.body;
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
$metadata,
|
|
264
|
+
(0, smithy_client_1.throwDefaultError)({
|
|
265
|
+
output,
|
|
266
|
+
parsedBody,
|
|
267
|
+
exceptionCtor: LexRuntimeServiceServiceException_1.LexRuntimeServiceServiceException,
|
|
268
|
+
errorCode,
|
|
416
269
|
});
|
|
417
|
-
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
418
270
|
}
|
|
419
271
|
};
|
|
420
272
|
const deserializeAws_restJson1PostContentCommand = async (output, context) => {
|
|
421
273
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
422
274
|
return deserializeAws_restJson1PostContentCommandError(output, context);
|
|
423
275
|
}
|
|
424
|
-
const contents = {
|
|
276
|
+
const contents = map({
|
|
425
277
|
$metadata: deserializeMetadata(output),
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
sessionAttributes:
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
}
|
|
460
|
-
if (output.headers["x-amz-lex-session-attributes"] !== undefined) {
|
|
461
|
-
contents.sessionAttributes = new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-session-attributes"])).toString("utf8"));
|
|
462
|
-
}
|
|
463
|
-
if (output.headers["x-amz-lex-sentiment"] !== undefined) {
|
|
464
|
-
contents.sentimentResponse = output.headers["x-amz-lex-sentiment"];
|
|
465
|
-
}
|
|
466
|
-
if (output.headers["x-amz-lex-message"] !== undefined) {
|
|
467
|
-
contents.message = output.headers["x-amz-lex-message"];
|
|
468
|
-
}
|
|
469
|
-
if (output.headers["x-amz-lex-encoded-message"] !== undefined) {
|
|
470
|
-
contents.encodedMessage = output.headers["x-amz-lex-encoded-message"];
|
|
471
|
-
}
|
|
472
|
-
if (output.headers["x-amz-lex-message-format"] !== undefined) {
|
|
473
|
-
contents.messageFormat = output.headers["x-amz-lex-message-format"];
|
|
474
|
-
}
|
|
475
|
-
if (output.headers["x-amz-lex-dialog-state"] !== undefined) {
|
|
476
|
-
contents.dialogState = output.headers["x-amz-lex-dialog-state"];
|
|
477
|
-
}
|
|
478
|
-
if (output.headers["x-amz-lex-slot-to-elicit"] !== undefined) {
|
|
479
|
-
contents.slotToElicit = output.headers["x-amz-lex-slot-to-elicit"];
|
|
480
|
-
}
|
|
481
|
-
if (output.headers["x-amz-lex-input-transcript"] !== undefined) {
|
|
482
|
-
contents.inputTranscript = output.headers["x-amz-lex-input-transcript"];
|
|
483
|
-
}
|
|
484
|
-
if (output.headers["x-amz-lex-encoded-input-transcript"] !== undefined) {
|
|
485
|
-
contents.encodedInputTranscript = output.headers["x-amz-lex-encoded-input-transcript"];
|
|
486
|
-
}
|
|
487
|
-
if (output.headers["x-amz-lex-bot-version"] !== undefined) {
|
|
488
|
-
contents.botVersion = output.headers["x-amz-lex-bot-version"];
|
|
489
|
-
}
|
|
490
|
-
if (output.headers["x-amz-lex-session-id"] !== undefined) {
|
|
491
|
-
contents.sessionId = output.headers["x-amz-lex-session-id"];
|
|
492
|
-
}
|
|
493
|
-
if (output.headers["x-amz-lex-active-contexts"] !== undefined) {
|
|
494
|
-
contents.activeContexts = new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-active-contexts"])).toString("utf8"));
|
|
495
|
-
}
|
|
278
|
+
contentType: [, output.headers["content-type"]],
|
|
279
|
+
intentName: [, output.headers["x-amz-lex-intent-name"]],
|
|
280
|
+
nluIntentConfidence: [
|
|
281
|
+
() => void 0 !== output.headers["x-amz-lex-nlu-intent-confidence"],
|
|
282
|
+
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-nlu-intent-confidence"])).toString("utf8")),
|
|
283
|
+
],
|
|
284
|
+
alternativeIntents: [
|
|
285
|
+
() => void 0 !== output.headers["x-amz-lex-alternative-intents"],
|
|
286
|
+
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-alternative-intents"])).toString("utf8")),
|
|
287
|
+
],
|
|
288
|
+
slots: [
|
|
289
|
+
() => void 0 !== output.headers["x-amz-lex-slots"],
|
|
290
|
+
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-slots"])).toString("utf8")),
|
|
291
|
+
],
|
|
292
|
+
sessionAttributes: [
|
|
293
|
+
() => void 0 !== output.headers["x-amz-lex-session-attributes"],
|
|
294
|
+
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-session-attributes"])).toString("utf8")),
|
|
295
|
+
],
|
|
296
|
+
sentimentResponse: [, output.headers["x-amz-lex-sentiment"]],
|
|
297
|
+
message: [, output.headers["x-amz-lex-message"]],
|
|
298
|
+
encodedMessage: [, output.headers["x-amz-lex-encoded-message"]],
|
|
299
|
+
messageFormat: [, output.headers["x-amz-lex-message-format"]],
|
|
300
|
+
dialogState: [, output.headers["x-amz-lex-dialog-state"]],
|
|
301
|
+
slotToElicit: [, output.headers["x-amz-lex-slot-to-elicit"]],
|
|
302
|
+
inputTranscript: [, output.headers["x-amz-lex-input-transcript"]],
|
|
303
|
+
encodedInputTranscript: [, output.headers["x-amz-lex-encoded-input-transcript"]],
|
|
304
|
+
botVersion: [, output.headers["x-amz-lex-bot-version"]],
|
|
305
|
+
sessionId: [, output.headers["x-amz-lex-session-id"]],
|
|
306
|
+
activeContexts: [
|
|
307
|
+
() => void 0 !== output.headers["x-amz-lex-active-contexts"],
|
|
308
|
+
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-active-contexts"])).toString("utf8")),
|
|
309
|
+
],
|
|
310
|
+
});
|
|
496
311
|
const data = output.body;
|
|
497
312
|
contents.audioStream = data;
|
|
498
|
-
return
|
|
313
|
+
return contents;
|
|
499
314
|
};
|
|
500
315
|
exports.deserializeAws_restJson1PostContentCommand = deserializeAws_restJson1PostContentCommand;
|
|
501
316
|
const deserializeAws_restJson1PostContentCommandError = async (output, context) => {
|
|
@@ -503,7 +318,6 @@ const deserializeAws_restJson1PostContentCommandError = async (output, context)
|
|
|
503
318
|
...output,
|
|
504
319
|
body: await parseBody(output.body, context),
|
|
505
320
|
};
|
|
506
|
-
let response;
|
|
507
321
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
508
322
|
switch (errorCode) {
|
|
509
323
|
case "BadGatewayException":
|
|
@@ -541,81 +355,65 @@ const deserializeAws_restJson1PostContentCommandError = async (output, context)
|
|
|
541
355
|
throw await deserializeAws_restJson1UnsupportedMediaTypeExceptionResponse(parsedOutput, context);
|
|
542
356
|
default:
|
|
543
357
|
const parsedBody = parsedOutput.body;
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
$metadata,
|
|
358
|
+
(0, smithy_client_1.throwDefaultError)({
|
|
359
|
+
output,
|
|
360
|
+
parsedBody,
|
|
361
|
+
exceptionCtor: LexRuntimeServiceServiceException_1.LexRuntimeServiceServiceException,
|
|
362
|
+
errorCode,
|
|
550
363
|
});
|
|
551
|
-
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
552
364
|
}
|
|
553
365
|
};
|
|
554
366
|
const deserializeAws_restJson1PostTextCommand = async (output, context) => {
|
|
555
367
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
556
368
|
return deserializeAws_restJson1PostTextCommandError(output, context);
|
|
557
369
|
}
|
|
558
|
-
const contents = {
|
|
370
|
+
const contents = map({
|
|
559
371
|
$metadata: deserializeMetadata(output),
|
|
560
|
-
|
|
561
|
-
alternativeIntents: undefined,
|
|
562
|
-
botVersion: undefined,
|
|
563
|
-
dialogState: undefined,
|
|
564
|
-
intentName: undefined,
|
|
565
|
-
message: undefined,
|
|
566
|
-
messageFormat: undefined,
|
|
567
|
-
nluIntentConfidence: undefined,
|
|
568
|
-
responseCard: undefined,
|
|
569
|
-
sentimentResponse: undefined,
|
|
570
|
-
sessionAttributes: undefined,
|
|
571
|
-
sessionId: undefined,
|
|
572
|
-
slotToElicit: undefined,
|
|
573
|
-
slots: undefined,
|
|
574
|
-
};
|
|
372
|
+
});
|
|
575
373
|
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
576
|
-
if (data.activeContexts
|
|
374
|
+
if (data.activeContexts != null) {
|
|
577
375
|
contents.activeContexts = deserializeAws_restJson1ActiveContextsList(data.activeContexts, context);
|
|
578
376
|
}
|
|
579
|
-
if (data.alternativeIntents
|
|
377
|
+
if (data.alternativeIntents != null) {
|
|
580
378
|
contents.alternativeIntents = deserializeAws_restJson1IntentList(data.alternativeIntents, context);
|
|
581
379
|
}
|
|
582
|
-
if (data.botVersion
|
|
380
|
+
if (data.botVersion != null) {
|
|
583
381
|
contents.botVersion = (0, smithy_client_1.expectString)(data.botVersion);
|
|
584
382
|
}
|
|
585
|
-
if (data.dialogState
|
|
383
|
+
if (data.dialogState != null) {
|
|
586
384
|
contents.dialogState = (0, smithy_client_1.expectString)(data.dialogState);
|
|
587
385
|
}
|
|
588
|
-
if (data.intentName
|
|
386
|
+
if (data.intentName != null) {
|
|
589
387
|
contents.intentName = (0, smithy_client_1.expectString)(data.intentName);
|
|
590
388
|
}
|
|
591
|
-
if (data.message
|
|
389
|
+
if (data.message != null) {
|
|
592
390
|
contents.message = (0, smithy_client_1.expectString)(data.message);
|
|
593
391
|
}
|
|
594
|
-
if (data.messageFormat
|
|
392
|
+
if (data.messageFormat != null) {
|
|
595
393
|
contents.messageFormat = (0, smithy_client_1.expectString)(data.messageFormat);
|
|
596
394
|
}
|
|
597
|
-
if (data.nluIntentConfidence
|
|
395
|
+
if (data.nluIntentConfidence != null) {
|
|
598
396
|
contents.nluIntentConfidence = deserializeAws_restJson1IntentConfidence(data.nluIntentConfidence, context);
|
|
599
397
|
}
|
|
600
|
-
if (data.responseCard
|
|
398
|
+
if (data.responseCard != null) {
|
|
601
399
|
contents.responseCard = deserializeAws_restJson1ResponseCard(data.responseCard, context);
|
|
602
400
|
}
|
|
603
|
-
if (data.sentimentResponse
|
|
401
|
+
if (data.sentimentResponse != null) {
|
|
604
402
|
contents.sentimentResponse = deserializeAws_restJson1SentimentResponse(data.sentimentResponse, context);
|
|
605
403
|
}
|
|
606
|
-
if (data.sessionAttributes
|
|
404
|
+
if (data.sessionAttributes != null) {
|
|
607
405
|
contents.sessionAttributes = deserializeAws_restJson1StringMap(data.sessionAttributes, context);
|
|
608
406
|
}
|
|
609
|
-
if (data.sessionId
|
|
407
|
+
if (data.sessionId != null) {
|
|
610
408
|
contents.sessionId = (0, smithy_client_1.expectString)(data.sessionId);
|
|
611
409
|
}
|
|
612
|
-
if (data.slotToElicit
|
|
410
|
+
if (data.slotToElicit != null) {
|
|
613
411
|
contents.slotToElicit = (0, smithy_client_1.expectString)(data.slotToElicit);
|
|
614
412
|
}
|
|
615
|
-
if (data.slots
|
|
413
|
+
if (data.slots != null) {
|
|
616
414
|
contents.slots = deserializeAws_restJson1StringMap(data.slots, context);
|
|
617
415
|
}
|
|
618
|
-
return
|
|
416
|
+
return contents;
|
|
619
417
|
};
|
|
620
418
|
exports.deserializeAws_restJson1PostTextCommand = deserializeAws_restJson1PostTextCommand;
|
|
621
419
|
const deserializeAws_restJson1PostTextCommandError = async (output, context) => {
|
|
@@ -623,7 +421,6 @@ const deserializeAws_restJson1PostTextCommandError = async (output, context) =>
|
|
|
623
421
|
...output,
|
|
624
422
|
body: await parseBody(output.body, context),
|
|
625
423
|
};
|
|
626
|
-
let response;
|
|
627
424
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
628
425
|
switch (errorCode) {
|
|
629
426
|
case "BadGatewayException":
|
|
@@ -652,71 +449,44 @@ const deserializeAws_restJson1PostTextCommandError = async (output, context) =>
|
|
|
652
449
|
throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
|
|
653
450
|
default:
|
|
654
451
|
const parsedBody = parsedOutput.body;
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
$metadata,
|
|
452
|
+
(0, smithy_client_1.throwDefaultError)({
|
|
453
|
+
output,
|
|
454
|
+
parsedBody,
|
|
455
|
+
exceptionCtor: LexRuntimeServiceServiceException_1.LexRuntimeServiceServiceException,
|
|
456
|
+
errorCode,
|
|
661
457
|
});
|
|
662
|
-
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
663
458
|
}
|
|
664
459
|
};
|
|
665
460
|
const deserializeAws_restJson1PutSessionCommand = async (output, context) => {
|
|
666
461
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
667
462
|
return deserializeAws_restJson1PutSessionCommandError(output, context);
|
|
668
463
|
}
|
|
669
|
-
const contents = {
|
|
464
|
+
const contents = map({
|
|
670
465
|
$metadata: deserializeMetadata(output),
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
}
|
|
693
|
-
if (output.headers["x-amz-lex-session-attributes"] !== undefined) {
|
|
694
|
-
contents.sessionAttributes = new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-session-attributes"])).toString("utf8"));
|
|
695
|
-
}
|
|
696
|
-
if (output.headers["x-amz-lex-message"] !== undefined) {
|
|
697
|
-
contents.message = output.headers["x-amz-lex-message"];
|
|
698
|
-
}
|
|
699
|
-
if (output.headers["x-amz-lex-encoded-message"] !== undefined) {
|
|
700
|
-
contents.encodedMessage = output.headers["x-amz-lex-encoded-message"];
|
|
701
|
-
}
|
|
702
|
-
if (output.headers["x-amz-lex-message-format"] !== undefined) {
|
|
703
|
-
contents.messageFormat = output.headers["x-amz-lex-message-format"];
|
|
704
|
-
}
|
|
705
|
-
if (output.headers["x-amz-lex-dialog-state"] !== undefined) {
|
|
706
|
-
contents.dialogState = output.headers["x-amz-lex-dialog-state"];
|
|
707
|
-
}
|
|
708
|
-
if (output.headers["x-amz-lex-slot-to-elicit"] !== undefined) {
|
|
709
|
-
contents.slotToElicit = output.headers["x-amz-lex-slot-to-elicit"];
|
|
710
|
-
}
|
|
711
|
-
if (output.headers["x-amz-lex-session-id"] !== undefined) {
|
|
712
|
-
contents.sessionId = output.headers["x-amz-lex-session-id"];
|
|
713
|
-
}
|
|
714
|
-
if (output.headers["x-amz-lex-active-contexts"] !== undefined) {
|
|
715
|
-
contents.activeContexts = new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-active-contexts"])).toString("utf8"));
|
|
716
|
-
}
|
|
466
|
+
contentType: [, output.headers["content-type"]],
|
|
467
|
+
intentName: [, output.headers["x-amz-lex-intent-name"]],
|
|
468
|
+
slots: [
|
|
469
|
+
() => void 0 !== output.headers["x-amz-lex-slots"],
|
|
470
|
+
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-slots"])).toString("utf8")),
|
|
471
|
+
],
|
|
472
|
+
sessionAttributes: [
|
|
473
|
+
() => void 0 !== output.headers["x-amz-lex-session-attributes"],
|
|
474
|
+
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-session-attributes"])).toString("utf8")),
|
|
475
|
+
],
|
|
476
|
+
message: [, output.headers["x-amz-lex-message"]],
|
|
477
|
+
encodedMessage: [, output.headers["x-amz-lex-encoded-message"]],
|
|
478
|
+
messageFormat: [, output.headers["x-amz-lex-message-format"]],
|
|
479
|
+
dialogState: [, output.headers["x-amz-lex-dialog-state"]],
|
|
480
|
+
slotToElicit: [, output.headers["x-amz-lex-slot-to-elicit"]],
|
|
481
|
+
sessionId: [, output.headers["x-amz-lex-session-id"]],
|
|
482
|
+
activeContexts: [
|
|
483
|
+
() => void 0 !== output.headers["x-amz-lex-active-contexts"],
|
|
484
|
+
() => new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-active-contexts"])).toString("utf8")),
|
|
485
|
+
],
|
|
486
|
+
});
|
|
717
487
|
const data = output.body;
|
|
718
488
|
contents.audioStream = data;
|
|
719
|
-
return
|
|
489
|
+
return contents;
|
|
720
490
|
};
|
|
721
491
|
exports.deserializeAws_restJson1PutSessionCommand = deserializeAws_restJson1PutSessionCommand;
|
|
722
492
|
const deserializeAws_restJson1PutSessionCommandError = async (output, context) => {
|
|
@@ -724,7 +494,6 @@ const deserializeAws_restJson1PutSessionCommandError = async (output, context) =
|
|
|
724
494
|
...output,
|
|
725
495
|
body: await parseBody(output.body, context),
|
|
726
496
|
};
|
|
727
|
-
let response;
|
|
728
497
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
729
498
|
switch (errorCode) {
|
|
730
499
|
case "BadGatewayException":
|
|
@@ -753,20 +522,19 @@ const deserializeAws_restJson1PutSessionCommandError = async (output, context) =
|
|
|
753
522
|
throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
|
|
754
523
|
default:
|
|
755
524
|
const parsedBody = parsedOutput.body;
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
$metadata,
|
|
525
|
+
(0, smithy_client_1.throwDefaultError)({
|
|
526
|
+
output,
|
|
527
|
+
parsedBody,
|
|
528
|
+
exceptionCtor: LexRuntimeServiceServiceException_1.LexRuntimeServiceServiceException,
|
|
529
|
+
errorCode,
|
|
762
530
|
});
|
|
763
|
-
throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
|
|
764
531
|
}
|
|
765
532
|
};
|
|
533
|
+
const map = smithy_client_1.map;
|
|
766
534
|
const deserializeAws_restJson1BadGatewayExceptionResponse = async (parsedOutput, context) => {
|
|
767
|
-
const contents = {};
|
|
535
|
+
const contents = map({});
|
|
768
536
|
const data = parsedOutput.body;
|
|
769
|
-
if (data.Message
|
|
537
|
+
if (data.Message != null) {
|
|
770
538
|
contents.Message = (0, smithy_client_1.expectString)(data.Message);
|
|
771
539
|
}
|
|
772
540
|
const exception = new models_0_1.BadGatewayException({
|
|
@@ -776,9 +544,9 @@ const deserializeAws_restJson1BadGatewayExceptionResponse = async (parsedOutput,
|
|
|
776
544
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
777
545
|
};
|
|
778
546
|
const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput, context) => {
|
|
779
|
-
const contents = {};
|
|
547
|
+
const contents = map({});
|
|
780
548
|
const data = parsedOutput.body;
|
|
781
|
-
if (data.message
|
|
549
|
+
if (data.message != null) {
|
|
782
550
|
contents.message = (0, smithy_client_1.expectString)(data.message);
|
|
783
551
|
}
|
|
784
552
|
const exception = new models_0_1.BadRequestException({
|
|
@@ -788,9 +556,9 @@ const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput,
|
|
|
788
556
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
789
557
|
};
|
|
790
558
|
const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
|
|
791
|
-
const contents = {};
|
|
559
|
+
const contents = map({});
|
|
792
560
|
const data = parsedOutput.body;
|
|
793
|
-
if (data.message
|
|
561
|
+
if (data.message != null) {
|
|
794
562
|
contents.message = (0, smithy_client_1.expectString)(data.message);
|
|
795
563
|
}
|
|
796
564
|
const exception = new models_0_1.ConflictException({
|
|
@@ -800,9 +568,9 @@ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, c
|
|
|
800
568
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
801
569
|
};
|
|
802
570
|
const deserializeAws_restJson1DependencyFailedExceptionResponse = async (parsedOutput, context) => {
|
|
803
|
-
const contents = {};
|
|
571
|
+
const contents = map({});
|
|
804
572
|
const data = parsedOutput.body;
|
|
805
|
-
if (data.Message
|
|
573
|
+
if (data.Message != null) {
|
|
806
574
|
contents.Message = (0, smithy_client_1.expectString)(data.Message);
|
|
807
575
|
}
|
|
808
576
|
const exception = new models_0_1.DependencyFailedException({
|
|
@@ -812,9 +580,9 @@ const deserializeAws_restJson1DependencyFailedExceptionResponse = async (parsedO
|
|
|
812
580
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
813
581
|
};
|
|
814
582
|
const deserializeAws_restJson1InternalFailureExceptionResponse = async (parsedOutput, context) => {
|
|
815
|
-
const contents = {};
|
|
583
|
+
const contents = map({});
|
|
816
584
|
const data = parsedOutput.body;
|
|
817
|
-
if (data.message
|
|
585
|
+
if (data.message != null) {
|
|
818
586
|
contents.message = (0, smithy_client_1.expectString)(data.message);
|
|
819
587
|
}
|
|
820
588
|
const exception = new models_0_1.InternalFailureException({
|
|
@@ -824,12 +592,11 @@ const deserializeAws_restJson1InternalFailureExceptionResponse = async (parsedOu
|
|
|
824
592
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
825
593
|
};
|
|
826
594
|
const deserializeAws_restJson1LimitExceededExceptionResponse = async (parsedOutput, context) => {
|
|
827
|
-
const contents = {
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
}
|
|
595
|
+
const contents = map({
|
|
596
|
+
retryAfterSeconds: [, parsedOutput.headers["retry-after"]],
|
|
597
|
+
});
|
|
831
598
|
const data = parsedOutput.body;
|
|
832
|
-
if (data.message
|
|
599
|
+
if (data.message != null) {
|
|
833
600
|
contents.message = (0, smithy_client_1.expectString)(data.message);
|
|
834
601
|
}
|
|
835
602
|
const exception = new models_0_1.LimitExceededException({
|
|
@@ -839,9 +606,9 @@ const deserializeAws_restJson1LimitExceededExceptionResponse = async (parsedOutp
|
|
|
839
606
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
840
607
|
};
|
|
841
608
|
const deserializeAws_restJson1LoopDetectedExceptionResponse = async (parsedOutput, context) => {
|
|
842
|
-
const contents = {};
|
|
609
|
+
const contents = map({});
|
|
843
610
|
const data = parsedOutput.body;
|
|
844
|
-
if (data.Message
|
|
611
|
+
if (data.Message != null) {
|
|
845
612
|
contents.Message = (0, smithy_client_1.expectString)(data.Message);
|
|
846
613
|
}
|
|
847
614
|
const exception = new models_0_1.LoopDetectedException({
|
|
@@ -851,9 +618,9 @@ const deserializeAws_restJson1LoopDetectedExceptionResponse = async (parsedOutpu
|
|
|
851
618
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
852
619
|
};
|
|
853
620
|
const deserializeAws_restJson1NotAcceptableExceptionResponse = async (parsedOutput, context) => {
|
|
854
|
-
const contents = {};
|
|
621
|
+
const contents = map({});
|
|
855
622
|
const data = parsedOutput.body;
|
|
856
|
-
if (data.message
|
|
623
|
+
if (data.message != null) {
|
|
857
624
|
contents.message = (0, smithy_client_1.expectString)(data.message);
|
|
858
625
|
}
|
|
859
626
|
const exception = new models_0_1.NotAcceptableException({
|
|
@@ -863,9 +630,9 @@ const deserializeAws_restJson1NotAcceptableExceptionResponse = async (parsedOutp
|
|
|
863
630
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
864
631
|
};
|
|
865
632
|
const deserializeAws_restJson1NotFoundExceptionResponse = async (parsedOutput, context) => {
|
|
866
|
-
const contents = {};
|
|
633
|
+
const contents = map({});
|
|
867
634
|
const data = parsedOutput.body;
|
|
868
|
-
if (data.message
|
|
635
|
+
if (data.message != null) {
|
|
869
636
|
contents.message = (0, smithy_client_1.expectString)(data.message);
|
|
870
637
|
}
|
|
871
638
|
const exception = new models_0_1.NotFoundException({
|
|
@@ -875,9 +642,9 @@ const deserializeAws_restJson1NotFoundExceptionResponse = async (parsedOutput, c
|
|
|
875
642
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
876
643
|
};
|
|
877
644
|
const deserializeAws_restJson1RequestTimeoutExceptionResponse = async (parsedOutput, context) => {
|
|
878
|
-
const contents = {};
|
|
645
|
+
const contents = map({});
|
|
879
646
|
const data = parsedOutput.body;
|
|
880
|
-
if (data.message
|
|
647
|
+
if (data.message != null) {
|
|
881
648
|
contents.message = (0, smithy_client_1.expectString)(data.message);
|
|
882
649
|
}
|
|
883
650
|
const exception = new models_0_1.RequestTimeoutException({
|
|
@@ -887,9 +654,9 @@ const deserializeAws_restJson1RequestTimeoutExceptionResponse = async (parsedOut
|
|
|
887
654
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
888
655
|
};
|
|
889
656
|
const deserializeAws_restJson1UnsupportedMediaTypeExceptionResponse = async (parsedOutput, context) => {
|
|
890
|
-
const contents = {};
|
|
657
|
+
const contents = map({});
|
|
891
658
|
const data = parsedOutput.body;
|
|
892
|
-
if (data.message
|
|
659
|
+
if (data.message != null) {
|
|
893
660
|
contents.message = (0, smithy_client_1.expectString)(data.message);
|
|
894
661
|
}
|
|
895
662
|
const exception = new models_0_1.UnsupportedMediaTypeException({
|
|
@@ -924,9 +691,6 @@ const serializeAws_restJson1ActiveContextsList = (input, context) => {
|
|
|
924
691
|
return input
|
|
925
692
|
.filter((e) => e != null)
|
|
926
693
|
.map((entry) => {
|
|
927
|
-
if (entry === null) {
|
|
928
|
-
return null;
|
|
929
|
-
}
|
|
930
694
|
return serializeAws_restJson1ActiveContext(entry, context);
|
|
931
695
|
});
|
|
932
696
|
};
|
|
@@ -962,9 +726,6 @@ const serializeAws_restJson1IntentSummaryList = (input, context) => {
|
|
|
962
726
|
return input
|
|
963
727
|
.filter((e) => e != null)
|
|
964
728
|
.map((entry) => {
|
|
965
|
-
if (entry === null) {
|
|
966
|
-
return null;
|
|
967
|
-
}
|
|
968
729
|
return serializeAws_restJson1IntentSummary(entry, context);
|
|
969
730
|
});
|
|
970
731
|
};
|