@aws-sdk/client-lex-runtime-v2 3.185.0 → 3.188.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 +19 -0
- package/dist-cjs/protocols/Aws_restJson1.js +2 -0
- package/dist-cjs/runtimeConfig.browser.js +9 -7
- package/dist-cjs/runtimeConfig.js +9 -7
- package/dist-es/LexRuntimeV2.js +26 -33
- package/dist-es/LexRuntimeV2Client.js +24 -30
- package/dist-es/commands/DeleteSessionCommand.js +21 -28
- package/dist-es/commands/GetSessionCommand.js +21 -28
- package/dist-es/commands/PutSessionCommand.js +21 -28
- package/dist-es/commands/RecognizeTextCommand.js +21 -28
- package/dist-es/commands/RecognizeUtteranceCommand.js +21 -28
- package/dist-es/commands/StartConversationCommand.js +21 -28
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/LexRuntimeV2ServiceException.js +5 -10
- package/dist-es/models/models_0.js +237 -141
- package/dist-es/protocols/Aws_restJson1.js +1065 -1301
- package/dist-es/runtimeConfig.browser.js +31 -12
- package/dist-es/runtimeConfig.js +35 -19
- package/dist-es/runtimeConfig.native.js +10 -5
- package/dist-es/runtimeConfig.shared.js +8 -11
- package/dist-types/LexRuntimeV2Client.d.ts +6 -1
- package/dist-types/commands/PutSessionCommand.d.ts +2 -2
- package/dist-types/commands/RecognizeUtteranceCommand.d.ts +2 -2
- package/dist-types/protocols/Aws_restJson1.d.ts +3 -3
- package/dist-types/runtimeConfig.browser.d.ts +1 -0
- package/dist-types/runtimeConfig.d.ts +1 -0
- package/dist-types/runtimeConfig.native.d.ts +1 -0
- package/dist-types/ts3.4/LexRuntimeV2Client.d.ts +2 -0
- package/dist-types/ts3.4/commands/PutSessionCommand.d.ts +2 -1
- package/dist-types/ts3.4/commands/RecognizeUtteranceCommand.d.ts +2 -1
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +3 -2
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +1 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -0
- package/package.json +40 -38
|
@@ -1,1335 +1,1112 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator, __read } from "tslib";
|
|
2
1
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
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";
|
|
4
3
|
import { LexRuntimeV2ServiceException as __BaseException } from "../models/LexRuntimeV2ServiceException";
|
|
5
4
|
import { AccessDeniedException, BadGatewayException, ConflictException, DependencyFailedException, InternalServerException, ResourceNotFoundException, StartConversationRequestEventStream, ThrottlingException, ValidationException, } from "../models/models_0";
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
method: "DELETE",
|
|
25
|
-
headers: headers,
|
|
26
|
-
path: resolvedPath,
|
|
27
|
-
body: body,
|
|
28
|
-
})];
|
|
29
|
-
}
|
|
5
|
+
export const serializeAws_restJson1DeleteSessionCommand = async (input, context) => {
|
|
6
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
7
|
+
const headers = {};
|
|
8
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
9
|
+
"/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}";
|
|
10
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "botId", () => input.botId, "{botId}", false);
|
|
11
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "botAliasId", () => input.botAliasId, "{botAliasId}", false);
|
|
12
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "localeId", () => input.localeId, "{localeId}", false);
|
|
13
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "sessionId", () => input.sessionId, "{sessionId}", false);
|
|
14
|
+
let body;
|
|
15
|
+
return new __HttpRequest({
|
|
16
|
+
protocol,
|
|
17
|
+
hostname,
|
|
18
|
+
port,
|
|
19
|
+
method: "DELETE",
|
|
20
|
+
headers,
|
|
21
|
+
path: resolvedPath,
|
|
22
|
+
body,
|
|
30
23
|
});
|
|
31
|
-
}
|
|
32
|
-
export
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
method: "GET",
|
|
51
|
-
headers: headers,
|
|
52
|
-
path: resolvedPath,
|
|
53
|
-
body: body,
|
|
54
|
-
})];
|
|
55
|
-
}
|
|
24
|
+
};
|
|
25
|
+
export const serializeAws_restJson1GetSessionCommand = async (input, context) => {
|
|
26
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
27
|
+
const headers = {};
|
|
28
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
29
|
+
"/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}";
|
|
30
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "botId", () => input.botId, "{botId}", false);
|
|
31
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "botAliasId", () => input.botAliasId, "{botAliasId}", false);
|
|
32
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "localeId", () => input.localeId, "{localeId}", false);
|
|
33
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "sessionId", () => input.sessionId, "{sessionId}", false);
|
|
34
|
+
let body;
|
|
35
|
+
return new __HttpRequest({
|
|
36
|
+
protocol,
|
|
37
|
+
hostname,
|
|
38
|
+
port,
|
|
39
|
+
method: "GET",
|
|
40
|
+
headers,
|
|
41
|
+
path: resolvedPath,
|
|
42
|
+
body,
|
|
56
43
|
});
|
|
57
|
-
}
|
|
58
|
-
export
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
case 1:
|
|
64
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
65
|
-
headers = map({}, isSerializableHeaderValue, {
|
|
66
|
-
"content-type": "application/json",
|
|
67
|
-
responsecontenttype: input.responseContentType,
|
|
68
|
-
});
|
|
69
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
|
|
70
|
-
"/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}";
|
|
71
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "botId", function () { return input.botId; }, "{botId}", false);
|
|
72
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "botAliasId", function () { return input.botAliasId; }, "{botAliasId}", false);
|
|
73
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "localeId", function () { return input.localeId; }, "{localeId}", false);
|
|
74
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "sessionId", function () { return input.sessionId; }, "{sessionId}", false);
|
|
75
|
-
body = JSON.stringify(__assign(__assign(__assign({}, (input.messages != null && { messages: serializeAws_restJson1Messages(input.messages, context) })), (input.requestAttributes != null && {
|
|
76
|
-
requestAttributes: serializeAws_restJson1StringMap(input.requestAttributes, context),
|
|
77
|
-
})), (input.sessionState != null && {
|
|
78
|
-
sessionState: serializeAws_restJson1SessionState(input.sessionState, context),
|
|
79
|
-
})));
|
|
80
|
-
return [2, new __HttpRequest({
|
|
81
|
-
protocol: protocol,
|
|
82
|
-
hostname: hostname,
|
|
83
|
-
port: port,
|
|
84
|
-
method: "POST",
|
|
85
|
-
headers: headers,
|
|
86
|
-
path: resolvedPath,
|
|
87
|
-
body: body,
|
|
88
|
-
})];
|
|
89
|
-
}
|
|
44
|
+
};
|
|
45
|
+
export const serializeAws_restJson1PutSessionCommand = async (input, context) => {
|
|
46
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
47
|
+
const headers = map({}, isSerializableHeaderValue, {
|
|
48
|
+
"content-type": "application/json",
|
|
49
|
+
responsecontenttype: input.responseContentType,
|
|
90
50
|
});
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "localeId", function () { return input.localeId; }, "{localeId}", false);
|
|
107
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "sessionId", function () { return input.sessionId; }, "{sessionId}", false);
|
|
108
|
-
body = JSON.stringify(__assign(__assign(__assign({}, (input.requestAttributes != null && {
|
|
109
|
-
requestAttributes: serializeAws_restJson1StringMap(input.requestAttributes, context),
|
|
110
|
-
})), (input.sessionState != null && {
|
|
111
|
-
sessionState: serializeAws_restJson1SessionState(input.sessionState, context),
|
|
112
|
-
})), (input.text != null && { text: input.text })));
|
|
113
|
-
return [2, new __HttpRequest({
|
|
114
|
-
protocol: protocol,
|
|
115
|
-
hostname: hostname,
|
|
116
|
-
port: port,
|
|
117
|
-
method: "POST",
|
|
118
|
-
headers: headers,
|
|
119
|
-
path: resolvedPath,
|
|
120
|
-
body: body,
|
|
121
|
-
})];
|
|
122
|
-
}
|
|
51
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
52
|
+
"/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}";
|
|
53
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "botId", () => input.botId, "{botId}", false);
|
|
54
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "botAliasId", () => input.botAliasId, "{botAliasId}", false);
|
|
55
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "localeId", () => input.localeId, "{localeId}", false);
|
|
56
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "sessionId", () => input.sessionId, "{sessionId}", false);
|
|
57
|
+
let body;
|
|
58
|
+
body = JSON.stringify({
|
|
59
|
+
...(input.messages != null && { messages: serializeAws_restJson1Messages(input.messages, context) }),
|
|
60
|
+
...(input.requestAttributes != null && {
|
|
61
|
+
requestAttributes: serializeAws_restJson1StringMap(input.requestAttributes, context),
|
|
62
|
+
}),
|
|
63
|
+
...(input.sessionState != null && {
|
|
64
|
+
sessionState: serializeAws_restJson1SessionState(input.sessionState, context),
|
|
65
|
+
}),
|
|
123
66
|
});
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
headers = map({}, isSerializableHeaderValue, {
|
|
133
|
-
"x-amz-content-sha256": "UNSIGNED-PAYLOAD",
|
|
134
|
-
"content-type": input.requestContentType || "application/octet-stream",
|
|
135
|
-
"x-amz-lex-session-state": input.sessionState,
|
|
136
|
-
"x-amz-lex-request-attributes": input.requestAttributes,
|
|
137
|
-
"response-content-type": input.responseContentType,
|
|
138
|
-
});
|
|
139
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
|
|
140
|
-
"/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}/utterance";
|
|
141
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "botId", function () { return input.botId; }, "{botId}", false);
|
|
142
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "botAliasId", function () { return input.botAliasId; }, "{botAliasId}", false);
|
|
143
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "localeId", function () { return input.localeId; }, "{localeId}", false);
|
|
144
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "sessionId", function () { return input.sessionId; }, "{sessionId}", false);
|
|
145
|
-
if (input.inputStream !== undefined) {
|
|
146
|
-
body = input.inputStream;
|
|
147
|
-
}
|
|
148
|
-
return [2, new __HttpRequest({
|
|
149
|
-
protocol: protocol,
|
|
150
|
-
hostname: hostname,
|
|
151
|
-
port: port,
|
|
152
|
-
method: "POST",
|
|
153
|
-
headers: headers,
|
|
154
|
-
path: resolvedPath,
|
|
155
|
-
body: body,
|
|
156
|
-
})];
|
|
157
|
-
}
|
|
67
|
+
return new __HttpRequest({
|
|
68
|
+
protocol,
|
|
69
|
+
hostname,
|
|
70
|
+
port,
|
|
71
|
+
method: "POST",
|
|
72
|
+
headers,
|
|
73
|
+
path: resolvedPath,
|
|
74
|
+
body,
|
|
158
75
|
});
|
|
159
|
-
}
|
|
160
|
-
export
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
protocol: protocol,
|
|
181
|
-
hostname: hostname,
|
|
182
|
-
port: port,
|
|
183
|
-
method: "POST",
|
|
184
|
-
headers: headers,
|
|
185
|
-
path: resolvedPath,
|
|
186
|
-
body: body,
|
|
187
|
-
})];
|
|
188
|
-
}
|
|
76
|
+
};
|
|
77
|
+
export const serializeAws_restJson1RecognizeTextCommand = async (input, context) => {
|
|
78
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
79
|
+
const headers = {
|
|
80
|
+
"content-type": "application/json",
|
|
81
|
+
};
|
|
82
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
83
|
+
"/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}/text";
|
|
84
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "botId", () => input.botId, "{botId}", false);
|
|
85
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "botAliasId", () => input.botAliasId, "{botAliasId}", false);
|
|
86
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "localeId", () => input.localeId, "{localeId}", false);
|
|
87
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "sessionId", () => input.sessionId, "{sessionId}", false);
|
|
88
|
+
let body;
|
|
89
|
+
body = JSON.stringify({
|
|
90
|
+
...(input.requestAttributes != null && {
|
|
91
|
+
requestAttributes: serializeAws_restJson1StringMap(input.requestAttributes, context),
|
|
92
|
+
}),
|
|
93
|
+
...(input.sessionState != null && {
|
|
94
|
+
sessionState: serializeAws_restJson1SessionState(input.sessionState, context),
|
|
95
|
+
}),
|
|
96
|
+
...(input.text != null && { text: input.text }),
|
|
189
97
|
});
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}
|
|
199
|
-
contents = map({
|
|
200
|
-
$metadata: deserializeMetadata(output),
|
|
201
|
-
});
|
|
202
|
-
_a = __expectNonNull;
|
|
203
|
-
_b = __expectObject;
|
|
204
|
-
return [4, parseBody(output.body, context)];
|
|
205
|
-
case 1:
|
|
206
|
-
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
207
|
-
if (data.botAliasId != null) {
|
|
208
|
-
contents.botAliasId = __expectString(data.botAliasId);
|
|
209
|
-
}
|
|
210
|
-
if (data.botId != null) {
|
|
211
|
-
contents.botId = __expectString(data.botId);
|
|
212
|
-
}
|
|
213
|
-
if (data.localeId != null) {
|
|
214
|
-
contents.localeId = __expectString(data.localeId);
|
|
215
|
-
}
|
|
216
|
-
if (data.sessionId != null) {
|
|
217
|
-
contents.sessionId = __expectString(data.sessionId);
|
|
218
|
-
}
|
|
219
|
-
return [2, contents];
|
|
220
|
-
}
|
|
98
|
+
return new __HttpRequest({
|
|
99
|
+
protocol,
|
|
100
|
+
hostname,
|
|
101
|
+
port,
|
|
102
|
+
method: "POST",
|
|
103
|
+
headers,
|
|
104
|
+
path: resolvedPath,
|
|
105
|
+
body,
|
|
221
106
|
});
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
return [4, parseErrorBody(output.body, context)];
|
|
232
|
-
case 1:
|
|
233
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
234
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
235
|
-
_b = errorCode;
|
|
236
|
-
switch (_b) {
|
|
237
|
-
case "AccessDeniedException": return [3, 2];
|
|
238
|
-
case "com.amazonaws.lexruntimev2#AccessDeniedException": return [3, 2];
|
|
239
|
-
case "ConflictException": return [3, 4];
|
|
240
|
-
case "com.amazonaws.lexruntimev2#ConflictException": return [3, 4];
|
|
241
|
-
case "InternalServerException": return [3, 6];
|
|
242
|
-
case "com.amazonaws.lexruntimev2#InternalServerException": return [3, 6];
|
|
243
|
-
case "ResourceNotFoundException": return [3, 8];
|
|
244
|
-
case "com.amazonaws.lexruntimev2#ResourceNotFoundException": return [3, 8];
|
|
245
|
-
case "ThrottlingException": return [3, 10];
|
|
246
|
-
case "com.amazonaws.lexruntimev2#ThrottlingException": return [3, 10];
|
|
247
|
-
case "ValidationException": return [3, 12];
|
|
248
|
-
case "com.amazonaws.lexruntimev2#ValidationException": return [3, 12];
|
|
249
|
-
}
|
|
250
|
-
return [3, 14];
|
|
251
|
-
case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
252
|
-
case 3: throw _d.sent();
|
|
253
|
-
case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
|
|
254
|
-
case 5: throw _d.sent();
|
|
255
|
-
case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
256
|
-
case 7: throw _d.sent();
|
|
257
|
-
case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
258
|
-
case 9: throw _d.sent();
|
|
259
|
-
case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
260
|
-
case 11: throw _d.sent();
|
|
261
|
-
case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
262
|
-
case 13: throw _d.sent();
|
|
263
|
-
case 14:
|
|
264
|
-
parsedBody = parsedOutput.body;
|
|
265
|
-
throwDefaultError({
|
|
266
|
-
output: output,
|
|
267
|
-
parsedBody: parsedBody,
|
|
268
|
-
exceptionCtor: __BaseException,
|
|
269
|
-
errorCode: errorCode,
|
|
270
|
-
});
|
|
271
|
-
_d.label = 15;
|
|
272
|
-
case 15: return [2];
|
|
273
|
-
}
|
|
107
|
+
};
|
|
108
|
+
export const serializeAws_restJson1RecognizeUtteranceCommand = async (input, context) => {
|
|
109
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
110
|
+
const headers = map({}, isSerializableHeaderValue, {
|
|
111
|
+
"x-amz-content-sha256": "UNSIGNED-PAYLOAD",
|
|
112
|
+
"content-type": input.requestContentType || "application/octet-stream",
|
|
113
|
+
"x-amz-lex-session-state": input.sessionState,
|
|
114
|
+
"x-amz-lex-request-attributes": input.requestAttributes,
|
|
115
|
+
"response-content-type": input.responseContentType,
|
|
274
116
|
});
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
contents.interpretations = deserializeAws_restJson1Interpretations(data.interpretations, context);
|
|
294
|
-
}
|
|
295
|
-
if (data.messages != null) {
|
|
296
|
-
contents.messages = deserializeAws_restJson1Messages(data.messages, context);
|
|
297
|
-
}
|
|
298
|
-
if (data.sessionId != null) {
|
|
299
|
-
contents.sessionId = __expectString(data.sessionId);
|
|
300
|
-
}
|
|
301
|
-
if (data.sessionState != null) {
|
|
302
|
-
contents.sessionState = deserializeAws_restJson1SessionState(data.sessionState, context);
|
|
303
|
-
}
|
|
304
|
-
return [2, contents];
|
|
305
|
-
}
|
|
117
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
118
|
+
"/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}/utterance";
|
|
119
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "botId", () => input.botId, "{botId}", false);
|
|
120
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "botAliasId", () => input.botAliasId, "{botAliasId}", false);
|
|
121
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "localeId", () => input.localeId, "{localeId}", false);
|
|
122
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "sessionId", () => input.sessionId, "{sessionId}", false);
|
|
123
|
+
let body;
|
|
124
|
+
if (input.inputStream !== undefined) {
|
|
125
|
+
body = input.inputStream;
|
|
126
|
+
}
|
|
127
|
+
return new __HttpRequest({
|
|
128
|
+
protocol,
|
|
129
|
+
hostname,
|
|
130
|
+
port,
|
|
131
|
+
method: "POST",
|
|
132
|
+
headers,
|
|
133
|
+
path: resolvedPath,
|
|
134
|
+
body,
|
|
306
135
|
});
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
switch (_d.label) {
|
|
313
|
-
case 0:
|
|
314
|
-
_a = [__assign({}, output)];
|
|
315
|
-
_c = {};
|
|
316
|
-
return [4, parseErrorBody(output.body, context)];
|
|
317
|
-
case 1:
|
|
318
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
319
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
320
|
-
_b = errorCode;
|
|
321
|
-
switch (_b) {
|
|
322
|
-
case "AccessDeniedException": return [3, 2];
|
|
323
|
-
case "com.amazonaws.lexruntimev2#AccessDeniedException": return [3, 2];
|
|
324
|
-
case "InternalServerException": return [3, 4];
|
|
325
|
-
case "com.amazonaws.lexruntimev2#InternalServerException": return [3, 4];
|
|
326
|
-
case "ResourceNotFoundException": return [3, 6];
|
|
327
|
-
case "com.amazonaws.lexruntimev2#ResourceNotFoundException": return [3, 6];
|
|
328
|
-
case "ThrottlingException": return [3, 8];
|
|
329
|
-
case "com.amazonaws.lexruntimev2#ThrottlingException": return [3, 8];
|
|
330
|
-
case "ValidationException": return [3, 10];
|
|
331
|
-
case "com.amazonaws.lexruntimev2#ValidationException": return [3, 10];
|
|
332
|
-
}
|
|
333
|
-
return [3, 12];
|
|
334
|
-
case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
335
|
-
case 3: throw _d.sent();
|
|
336
|
-
case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
337
|
-
case 5: throw _d.sent();
|
|
338
|
-
case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
339
|
-
case 7: throw _d.sent();
|
|
340
|
-
case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
341
|
-
case 9: throw _d.sent();
|
|
342
|
-
case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
343
|
-
case 11: throw _d.sent();
|
|
344
|
-
case 12:
|
|
345
|
-
parsedBody = parsedOutput.body;
|
|
346
|
-
throwDefaultError({
|
|
347
|
-
output: output,
|
|
348
|
-
parsedBody: parsedBody,
|
|
349
|
-
exceptionCtor: __BaseException,
|
|
350
|
-
errorCode: errorCode,
|
|
351
|
-
});
|
|
352
|
-
_d.label = 13;
|
|
353
|
-
case 13: return [2];
|
|
354
|
-
}
|
|
136
|
+
};
|
|
137
|
+
export const serializeAws_restJson1StartConversationCommand = async (input, context) => {
|
|
138
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
139
|
+
const headers = map({}, isSerializableHeaderValue, {
|
|
140
|
+
"x-amz-lex-conversation-mode": input.conversationMode,
|
|
355
141
|
});
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
142
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
143
|
+
"/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}/conversation";
|
|
144
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "botId", () => input.botId, "{botId}", false);
|
|
145
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "botAliasId", () => input.botAliasId, "{botAliasId}", false);
|
|
146
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "localeId", () => input.localeId, "{localeId}", false);
|
|
147
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "sessionId", () => input.sessionId, "{sessionId}", false);
|
|
148
|
+
let body;
|
|
149
|
+
if (input.requestEventStream !== undefined) {
|
|
150
|
+
body = serializeAws_restJson1StartConversationRequestEventStream(input.requestEventStream, context);
|
|
151
|
+
}
|
|
152
|
+
return new __HttpRequest({
|
|
153
|
+
protocol,
|
|
154
|
+
hostname,
|
|
155
|
+
port,
|
|
156
|
+
method: "POST",
|
|
157
|
+
headers,
|
|
158
|
+
path: resolvedPath,
|
|
159
|
+
body,
|
|
374
160
|
});
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
_a = [__assign({}, output)];
|
|
383
|
-
_c = {};
|
|
384
|
-
return [4, parseErrorBody(output.body, context)];
|
|
385
|
-
case 1:
|
|
386
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
387
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
388
|
-
_b = errorCode;
|
|
389
|
-
switch (_b) {
|
|
390
|
-
case "AccessDeniedException": return [3, 2];
|
|
391
|
-
case "com.amazonaws.lexruntimev2#AccessDeniedException": return [3, 2];
|
|
392
|
-
case "BadGatewayException": return [3, 4];
|
|
393
|
-
case "com.amazonaws.lexruntimev2#BadGatewayException": return [3, 4];
|
|
394
|
-
case "ConflictException": return [3, 6];
|
|
395
|
-
case "com.amazonaws.lexruntimev2#ConflictException": return [3, 6];
|
|
396
|
-
case "DependencyFailedException": return [3, 8];
|
|
397
|
-
case "com.amazonaws.lexruntimev2#DependencyFailedException": return [3, 8];
|
|
398
|
-
case "InternalServerException": return [3, 10];
|
|
399
|
-
case "com.amazonaws.lexruntimev2#InternalServerException": return [3, 10];
|
|
400
|
-
case "ResourceNotFoundException": return [3, 12];
|
|
401
|
-
case "com.amazonaws.lexruntimev2#ResourceNotFoundException": return [3, 12];
|
|
402
|
-
case "ThrottlingException": return [3, 14];
|
|
403
|
-
case "com.amazonaws.lexruntimev2#ThrottlingException": return [3, 14];
|
|
404
|
-
case "ValidationException": return [3, 16];
|
|
405
|
-
case "com.amazonaws.lexruntimev2#ValidationException": return [3, 16];
|
|
406
|
-
}
|
|
407
|
-
return [3, 18];
|
|
408
|
-
case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
409
|
-
case 3: throw _d.sent();
|
|
410
|
-
case 4: return [4, deserializeAws_restJson1BadGatewayExceptionResponse(parsedOutput, context)];
|
|
411
|
-
case 5: throw _d.sent();
|
|
412
|
-
case 6: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
|
|
413
|
-
case 7: throw _d.sent();
|
|
414
|
-
case 8: return [4, deserializeAws_restJson1DependencyFailedExceptionResponse(parsedOutput, context)];
|
|
415
|
-
case 9: throw _d.sent();
|
|
416
|
-
case 10: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
417
|
-
case 11: throw _d.sent();
|
|
418
|
-
case 12: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
419
|
-
case 13: throw _d.sent();
|
|
420
|
-
case 14: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
421
|
-
case 15: throw _d.sent();
|
|
422
|
-
case 16: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
423
|
-
case 17: throw _d.sent();
|
|
424
|
-
case 18:
|
|
425
|
-
parsedBody = parsedOutput.body;
|
|
426
|
-
throwDefaultError({
|
|
427
|
-
output: output,
|
|
428
|
-
parsedBody: parsedBody,
|
|
429
|
-
exceptionCtor: __BaseException,
|
|
430
|
-
errorCode: errorCode,
|
|
431
|
-
});
|
|
432
|
-
_d.label = 19;
|
|
433
|
-
case 19: return [2];
|
|
434
|
-
}
|
|
161
|
+
};
|
|
162
|
+
export const deserializeAws_restJson1DeleteSessionCommand = async (output, context) => {
|
|
163
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
164
|
+
return deserializeAws_restJson1DeleteSessionCommandError(output, context);
|
|
165
|
+
}
|
|
166
|
+
const contents = map({
|
|
167
|
+
$metadata: deserializeMetadata(output),
|
|
435
168
|
});
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
169
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
170
|
+
if (data.botAliasId != null) {
|
|
171
|
+
contents.botAliasId = __expectString(data.botAliasId);
|
|
172
|
+
}
|
|
173
|
+
if (data.botId != null) {
|
|
174
|
+
contents.botId = __expectString(data.botId);
|
|
175
|
+
}
|
|
176
|
+
if (data.localeId != null) {
|
|
177
|
+
contents.localeId = __expectString(data.localeId);
|
|
178
|
+
}
|
|
179
|
+
if (data.sessionId != null) {
|
|
180
|
+
contents.sessionId = __expectString(data.sessionId);
|
|
181
|
+
}
|
|
182
|
+
return contents;
|
|
183
|
+
};
|
|
184
|
+
const deserializeAws_restJson1DeleteSessionCommandError = async (output, context) => {
|
|
185
|
+
const parsedOutput = {
|
|
186
|
+
...output,
|
|
187
|
+
body: await parseErrorBody(output.body, context),
|
|
188
|
+
};
|
|
189
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
190
|
+
switch (errorCode) {
|
|
191
|
+
case "AccessDeniedException":
|
|
192
|
+
case "com.amazonaws.lexruntimev2#AccessDeniedException":
|
|
193
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
194
|
+
case "ConflictException":
|
|
195
|
+
case "com.amazonaws.lexruntimev2#ConflictException":
|
|
196
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
197
|
+
case "InternalServerException":
|
|
198
|
+
case "com.amazonaws.lexruntimev2#InternalServerException":
|
|
199
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
200
|
+
case "ResourceNotFoundException":
|
|
201
|
+
case "com.amazonaws.lexruntimev2#ResourceNotFoundException":
|
|
202
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
203
|
+
case "ThrottlingException":
|
|
204
|
+
case "com.amazonaws.lexruntimev2#ThrottlingException":
|
|
205
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
206
|
+
case "ValidationException":
|
|
207
|
+
case "com.amazonaws.lexruntimev2#ValidationException":
|
|
208
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
209
|
+
default:
|
|
210
|
+
const parsedBody = parsedOutput.body;
|
|
211
|
+
throwDefaultError({
|
|
212
|
+
output,
|
|
213
|
+
parsedBody,
|
|
214
|
+
exceptionCtor: __BaseException,
|
|
215
|
+
errorCode,
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
export const deserializeAws_restJson1GetSessionCommand = async (output, context) => {
|
|
220
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
221
|
+
return deserializeAws_restJson1GetSessionCommandError(output, context);
|
|
222
|
+
}
|
|
223
|
+
const contents = map({
|
|
224
|
+
$metadata: deserializeMetadata(output),
|
|
470
225
|
});
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
case 19: return [2];
|
|
530
|
-
}
|
|
226
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
227
|
+
if (data.interpretations != null) {
|
|
228
|
+
contents.interpretations = deserializeAws_restJson1Interpretations(data.interpretations, context);
|
|
229
|
+
}
|
|
230
|
+
if (data.messages != null) {
|
|
231
|
+
contents.messages = deserializeAws_restJson1Messages(data.messages, context);
|
|
232
|
+
}
|
|
233
|
+
if (data.sessionId != null) {
|
|
234
|
+
contents.sessionId = __expectString(data.sessionId);
|
|
235
|
+
}
|
|
236
|
+
if (data.sessionState != null) {
|
|
237
|
+
contents.sessionState = deserializeAws_restJson1SessionState(data.sessionState, context);
|
|
238
|
+
}
|
|
239
|
+
return contents;
|
|
240
|
+
};
|
|
241
|
+
const deserializeAws_restJson1GetSessionCommandError = async (output, context) => {
|
|
242
|
+
const parsedOutput = {
|
|
243
|
+
...output,
|
|
244
|
+
body: await parseErrorBody(output.body, context),
|
|
245
|
+
};
|
|
246
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
247
|
+
switch (errorCode) {
|
|
248
|
+
case "AccessDeniedException":
|
|
249
|
+
case "com.amazonaws.lexruntimev2#AccessDeniedException":
|
|
250
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
251
|
+
case "InternalServerException":
|
|
252
|
+
case "com.amazonaws.lexruntimev2#InternalServerException":
|
|
253
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
254
|
+
case "ResourceNotFoundException":
|
|
255
|
+
case "com.amazonaws.lexruntimev2#ResourceNotFoundException":
|
|
256
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
257
|
+
case "ThrottlingException":
|
|
258
|
+
case "com.amazonaws.lexruntimev2#ThrottlingException":
|
|
259
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
260
|
+
case "ValidationException":
|
|
261
|
+
case "com.amazonaws.lexruntimev2#ValidationException":
|
|
262
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
263
|
+
default:
|
|
264
|
+
const parsedBody = parsedOutput.body;
|
|
265
|
+
throwDefaultError({
|
|
266
|
+
output,
|
|
267
|
+
parsedBody,
|
|
268
|
+
exceptionCtor: __BaseException,
|
|
269
|
+
errorCode,
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
export const deserializeAws_restJson1PutSessionCommand = async (output, context) => {
|
|
274
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
275
|
+
return deserializeAws_restJson1PutSessionCommandError(output, context);
|
|
276
|
+
}
|
|
277
|
+
const contents = map({
|
|
278
|
+
$metadata: deserializeMetadata(output),
|
|
279
|
+
contentType: [, output.headers["content-type"]],
|
|
280
|
+
messages: [, output.headers["x-amz-lex-messages"]],
|
|
281
|
+
sessionState: [, output.headers["x-amz-lex-session-state"]],
|
|
282
|
+
requestAttributes: [, output.headers["x-amz-lex-request-attributes"]],
|
|
283
|
+
sessionId: [, output.headers["x-amz-lex-session-id"]],
|
|
531
284
|
});
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
return
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
285
|
+
const data = output.body;
|
|
286
|
+
context.sdkStreamMixin(data);
|
|
287
|
+
contents.audioStream = data;
|
|
288
|
+
return contents;
|
|
289
|
+
};
|
|
290
|
+
const deserializeAws_restJson1PutSessionCommandError = async (output, context) => {
|
|
291
|
+
const parsedOutput = {
|
|
292
|
+
...output,
|
|
293
|
+
body: await parseErrorBody(output.body, context),
|
|
294
|
+
};
|
|
295
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
296
|
+
switch (errorCode) {
|
|
297
|
+
case "AccessDeniedException":
|
|
298
|
+
case "com.amazonaws.lexruntimev2#AccessDeniedException":
|
|
299
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
300
|
+
case "BadGatewayException":
|
|
301
|
+
case "com.amazonaws.lexruntimev2#BadGatewayException":
|
|
302
|
+
throw await deserializeAws_restJson1BadGatewayExceptionResponse(parsedOutput, context);
|
|
303
|
+
case "ConflictException":
|
|
304
|
+
case "com.amazonaws.lexruntimev2#ConflictException":
|
|
305
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
306
|
+
case "DependencyFailedException":
|
|
307
|
+
case "com.amazonaws.lexruntimev2#DependencyFailedException":
|
|
308
|
+
throw await deserializeAws_restJson1DependencyFailedExceptionResponse(parsedOutput, context);
|
|
309
|
+
case "InternalServerException":
|
|
310
|
+
case "com.amazonaws.lexruntimev2#InternalServerException":
|
|
311
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
312
|
+
case "ResourceNotFoundException":
|
|
313
|
+
case "com.amazonaws.lexruntimev2#ResourceNotFoundException":
|
|
314
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
315
|
+
case "ThrottlingException":
|
|
316
|
+
case "com.amazonaws.lexruntimev2#ThrottlingException":
|
|
317
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
318
|
+
case "ValidationException":
|
|
319
|
+
case "com.amazonaws.lexruntimev2#ValidationException":
|
|
320
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
321
|
+
default:
|
|
322
|
+
const parsedBody = parsedOutput.body;
|
|
323
|
+
throwDefaultError({
|
|
324
|
+
output,
|
|
325
|
+
parsedBody,
|
|
326
|
+
exceptionCtor: __BaseException,
|
|
327
|
+
errorCode,
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
export const deserializeAws_restJson1RecognizeTextCommand = async (output, context) => {
|
|
332
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
333
|
+
return deserializeAws_restJson1RecognizeTextCommandError(output, context);
|
|
334
|
+
}
|
|
335
|
+
const contents = map({
|
|
336
|
+
$metadata: deserializeMetadata(output),
|
|
553
337
|
});
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
338
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
339
|
+
if (data.interpretations != null) {
|
|
340
|
+
contents.interpretations = deserializeAws_restJson1Interpretations(data.interpretations, context);
|
|
341
|
+
}
|
|
342
|
+
if (data.messages != null) {
|
|
343
|
+
contents.messages = deserializeAws_restJson1Messages(data.messages, context);
|
|
344
|
+
}
|
|
345
|
+
if (data.requestAttributes != null) {
|
|
346
|
+
contents.requestAttributes = deserializeAws_restJson1StringMap(data.requestAttributes, context);
|
|
347
|
+
}
|
|
348
|
+
if (data.sessionId != null) {
|
|
349
|
+
contents.sessionId = __expectString(data.sessionId);
|
|
350
|
+
}
|
|
351
|
+
if (data.sessionState != null) {
|
|
352
|
+
contents.sessionState = deserializeAws_restJson1SessionState(data.sessionState, context);
|
|
353
|
+
}
|
|
354
|
+
return contents;
|
|
355
|
+
};
|
|
356
|
+
const deserializeAws_restJson1RecognizeTextCommandError = async (output, context) => {
|
|
357
|
+
const parsedOutput = {
|
|
358
|
+
...output,
|
|
359
|
+
body: await parseErrorBody(output.body, context),
|
|
360
|
+
};
|
|
361
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
362
|
+
switch (errorCode) {
|
|
363
|
+
case "AccessDeniedException":
|
|
364
|
+
case "com.amazonaws.lexruntimev2#AccessDeniedException":
|
|
365
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
366
|
+
case "BadGatewayException":
|
|
367
|
+
case "com.amazonaws.lexruntimev2#BadGatewayException":
|
|
368
|
+
throw await deserializeAws_restJson1BadGatewayExceptionResponse(parsedOutput, context);
|
|
369
|
+
case "ConflictException":
|
|
370
|
+
case "com.amazonaws.lexruntimev2#ConflictException":
|
|
371
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
372
|
+
case "DependencyFailedException":
|
|
373
|
+
case "com.amazonaws.lexruntimev2#DependencyFailedException":
|
|
374
|
+
throw await deserializeAws_restJson1DependencyFailedExceptionResponse(parsedOutput, context);
|
|
375
|
+
case "InternalServerException":
|
|
376
|
+
case "com.amazonaws.lexruntimev2#InternalServerException":
|
|
377
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
378
|
+
case "ResourceNotFoundException":
|
|
379
|
+
case "com.amazonaws.lexruntimev2#ResourceNotFoundException":
|
|
380
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
381
|
+
case "ThrottlingException":
|
|
382
|
+
case "com.amazonaws.lexruntimev2#ThrottlingException":
|
|
383
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
384
|
+
case "ValidationException":
|
|
385
|
+
case "com.amazonaws.lexruntimev2#ValidationException":
|
|
386
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
387
|
+
default:
|
|
388
|
+
const parsedBody = parsedOutput.body;
|
|
389
|
+
throwDefaultError({
|
|
390
|
+
output,
|
|
391
|
+
parsedBody,
|
|
392
|
+
exceptionCtor: __BaseException,
|
|
393
|
+
errorCode,
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
export const deserializeAws_restJson1RecognizeUtteranceCommand = async (output, context) => {
|
|
398
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
399
|
+
return deserializeAws_restJson1RecognizeUtteranceCommandError(output, context);
|
|
400
|
+
}
|
|
401
|
+
const contents = map({
|
|
402
|
+
$metadata: deserializeMetadata(output),
|
|
403
|
+
inputMode: [, output.headers["x-amz-lex-input-mode"]],
|
|
404
|
+
contentType: [, output.headers["content-type"]],
|
|
405
|
+
messages: [, output.headers["x-amz-lex-messages"]],
|
|
406
|
+
interpretations: [, output.headers["x-amz-lex-interpretations"]],
|
|
407
|
+
sessionState: [, output.headers["x-amz-lex-session-state"]],
|
|
408
|
+
requestAttributes: [, output.headers["x-amz-lex-request-attributes"]],
|
|
409
|
+
sessionId: [, output.headers["x-amz-lex-session-id"]],
|
|
410
|
+
inputTranscript: [, output.headers["x-amz-lex-input-transcript"]],
|
|
614
411
|
});
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
return
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
412
|
+
const data = output.body;
|
|
413
|
+
context.sdkStreamMixin(data);
|
|
414
|
+
contents.audioStream = data;
|
|
415
|
+
return contents;
|
|
416
|
+
};
|
|
417
|
+
const deserializeAws_restJson1RecognizeUtteranceCommandError = async (output, context) => {
|
|
418
|
+
const parsedOutput = {
|
|
419
|
+
...output,
|
|
420
|
+
body: await parseErrorBody(output.body, context),
|
|
421
|
+
};
|
|
422
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
423
|
+
switch (errorCode) {
|
|
424
|
+
case "AccessDeniedException":
|
|
425
|
+
case "com.amazonaws.lexruntimev2#AccessDeniedException":
|
|
426
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
427
|
+
case "BadGatewayException":
|
|
428
|
+
case "com.amazonaws.lexruntimev2#BadGatewayException":
|
|
429
|
+
throw await deserializeAws_restJson1BadGatewayExceptionResponse(parsedOutput, context);
|
|
430
|
+
case "ConflictException":
|
|
431
|
+
case "com.amazonaws.lexruntimev2#ConflictException":
|
|
432
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
433
|
+
case "DependencyFailedException":
|
|
434
|
+
case "com.amazonaws.lexruntimev2#DependencyFailedException":
|
|
435
|
+
throw await deserializeAws_restJson1DependencyFailedExceptionResponse(parsedOutput, context);
|
|
436
|
+
case "InternalServerException":
|
|
437
|
+
case "com.amazonaws.lexruntimev2#InternalServerException":
|
|
438
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
439
|
+
case "ResourceNotFoundException":
|
|
440
|
+
case "com.amazonaws.lexruntimev2#ResourceNotFoundException":
|
|
441
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
442
|
+
case "ThrottlingException":
|
|
443
|
+
case "com.amazonaws.lexruntimev2#ThrottlingException":
|
|
444
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
445
|
+
case "ValidationException":
|
|
446
|
+
case "com.amazonaws.lexruntimev2#ValidationException":
|
|
447
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
448
|
+
default:
|
|
449
|
+
const parsedBody = parsedOutput.body;
|
|
450
|
+
throwDefaultError({
|
|
451
|
+
output,
|
|
452
|
+
parsedBody,
|
|
453
|
+
exceptionCtor: __BaseException,
|
|
454
|
+
errorCode,
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
export const deserializeAws_restJson1StartConversationCommand = async (output, context) => {
|
|
459
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
460
|
+
return deserializeAws_restJson1StartConversationCommandError(output, context);
|
|
461
|
+
}
|
|
462
|
+
const contents = map({
|
|
463
|
+
$metadata: deserializeMetadata(output),
|
|
628
464
|
});
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
}
|
|
465
|
+
const data = output.body;
|
|
466
|
+
contents.responseEventStream = deserializeAws_restJson1StartConversationResponseEventStream(data, context);
|
|
467
|
+
return contents;
|
|
468
|
+
};
|
|
469
|
+
const deserializeAws_restJson1StartConversationCommandError = async (output, context) => {
|
|
470
|
+
const parsedOutput = {
|
|
471
|
+
...output,
|
|
472
|
+
body: await parseErrorBody(output.body, context),
|
|
473
|
+
};
|
|
474
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
475
|
+
switch (errorCode) {
|
|
476
|
+
case "AccessDeniedException":
|
|
477
|
+
case "com.amazonaws.lexruntimev2#AccessDeniedException":
|
|
478
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
479
|
+
case "InternalServerException":
|
|
480
|
+
case "com.amazonaws.lexruntimev2#InternalServerException":
|
|
481
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
482
|
+
case "ThrottlingException":
|
|
483
|
+
case "com.amazonaws.lexruntimev2#ThrottlingException":
|
|
484
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
485
|
+
case "ValidationException":
|
|
486
|
+
case "com.amazonaws.lexruntimev2#ValidationException":
|
|
487
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
488
|
+
default:
|
|
489
|
+
const parsedBody = parsedOutput.body;
|
|
490
|
+
throwDefaultError({
|
|
491
|
+
output,
|
|
492
|
+
parsedBody,
|
|
493
|
+
exceptionCtor: __BaseException,
|
|
494
|
+
errorCode,
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
const map = __map;
|
|
499
|
+
const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
|
|
500
|
+
const contents = map({});
|
|
501
|
+
const data = parsedOutput.body;
|
|
502
|
+
if (data.message != null) {
|
|
503
|
+
contents.message = __expectString(data.message);
|
|
504
|
+
}
|
|
505
|
+
const exception = new AccessDeniedException({
|
|
506
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
507
|
+
...contents,
|
|
673
508
|
});
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
509
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
510
|
+
};
|
|
511
|
+
const deserializeAws_restJson1BadGatewayExceptionResponse = async (parsedOutput, context) => {
|
|
512
|
+
const contents = map({});
|
|
513
|
+
const data = parsedOutput.body;
|
|
514
|
+
if (data.message != null) {
|
|
515
|
+
contents.message = __expectString(data.message);
|
|
516
|
+
}
|
|
517
|
+
const exception = new BadGatewayException({
|
|
518
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
519
|
+
...contents,
|
|
686
520
|
});
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
521
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
522
|
+
};
|
|
523
|
+
const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
|
|
524
|
+
const contents = map({});
|
|
525
|
+
const data = parsedOutput.body;
|
|
526
|
+
if (data.message != null) {
|
|
527
|
+
contents.message = __expectString(data.message);
|
|
528
|
+
}
|
|
529
|
+
const exception = new ConflictException({
|
|
530
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
531
|
+
...contents,
|
|
698
532
|
});
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
533
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
534
|
+
};
|
|
535
|
+
const deserializeAws_restJson1DependencyFailedExceptionResponse = async (parsedOutput, context) => {
|
|
536
|
+
const contents = map({});
|
|
537
|
+
const data = parsedOutput.body;
|
|
538
|
+
if (data.message != null) {
|
|
539
|
+
contents.message = __expectString(data.message);
|
|
540
|
+
}
|
|
541
|
+
const exception = new DependencyFailedException({
|
|
542
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
543
|
+
...contents,
|
|
710
544
|
});
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
545
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
546
|
+
};
|
|
547
|
+
const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
|
|
548
|
+
const contents = map({});
|
|
549
|
+
const data = parsedOutput.body;
|
|
550
|
+
if (data.message != null) {
|
|
551
|
+
contents.message = __expectString(data.message);
|
|
552
|
+
}
|
|
553
|
+
const exception = new InternalServerException({
|
|
554
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
555
|
+
...contents,
|
|
722
556
|
});
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
557
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
558
|
+
};
|
|
559
|
+
const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
|
|
560
|
+
const contents = map({});
|
|
561
|
+
const data = parsedOutput.body;
|
|
562
|
+
if (data.message != null) {
|
|
563
|
+
contents.message = __expectString(data.message);
|
|
564
|
+
}
|
|
565
|
+
const exception = new ResourceNotFoundException({
|
|
566
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
567
|
+
...contents,
|
|
734
568
|
});
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
569
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
570
|
+
};
|
|
571
|
+
const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
|
|
572
|
+
const contents = map({});
|
|
573
|
+
const data = parsedOutput.body;
|
|
574
|
+
if (data.message != null) {
|
|
575
|
+
contents.message = __expectString(data.message);
|
|
576
|
+
}
|
|
577
|
+
const exception = new ThrottlingException({
|
|
578
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
579
|
+
...contents,
|
|
746
580
|
});
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
581
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
582
|
+
};
|
|
583
|
+
const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
|
|
584
|
+
const contents = map({});
|
|
585
|
+
const data = parsedOutput.body;
|
|
586
|
+
if (data.message != null) {
|
|
587
|
+
contents.message = __expectString(data.message);
|
|
588
|
+
}
|
|
589
|
+
const exception = new ValidationException({
|
|
590
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
591
|
+
...contents,
|
|
758
592
|
});
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
593
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
594
|
+
};
|
|
595
|
+
const serializeAws_restJson1StartConversationRequestEventStream = (input, context) => {
|
|
596
|
+
const eventMarshallingVisitor = (event) => StartConversationRequestEventStream.visit(event, {
|
|
597
|
+
ConfigurationEvent: (value) => serializeAws_restJson1ConfigurationEvent_event(value, context),
|
|
598
|
+
AudioInputEvent: (value) => serializeAws_restJson1AudioInputEvent_event(value, context),
|
|
599
|
+
DTMFInputEvent: (value) => serializeAws_restJson1DTMFInputEvent_event(value, context),
|
|
600
|
+
TextInputEvent: (value) => serializeAws_restJson1TextInputEvent_event(value, context),
|
|
601
|
+
PlaybackCompletionEvent: (value) => serializeAws_restJson1PlaybackCompletionEvent_event(value, context),
|
|
602
|
+
DisconnectionEvent: (value) => serializeAws_restJson1DisconnectionEvent_event(value, context),
|
|
603
|
+
_: (value) => value,
|
|
770
604
|
});
|
|
771
|
-
}); };
|
|
772
|
-
var serializeAws_restJson1StartConversationRequestEventStream = function (input, context) {
|
|
773
|
-
var eventMarshallingVisitor = function (event) {
|
|
774
|
-
return StartConversationRequestEventStream.visit(event, {
|
|
775
|
-
ConfigurationEvent: function (value) { return serializeAws_restJson1ConfigurationEvent_event(value, context); },
|
|
776
|
-
AudioInputEvent: function (value) { return serializeAws_restJson1AudioInputEvent_event(value, context); },
|
|
777
|
-
DTMFInputEvent: function (value) { return serializeAws_restJson1DTMFInputEvent_event(value, context); },
|
|
778
|
-
TextInputEvent: function (value) { return serializeAws_restJson1TextInputEvent_event(value, context); },
|
|
779
|
-
PlaybackCompletionEvent: function (value) { return serializeAws_restJson1PlaybackCompletionEvent_event(value, context); },
|
|
780
|
-
DisconnectionEvent: function (value) { return serializeAws_restJson1DisconnectionEvent_event(value, context); },
|
|
781
|
-
_: function (value) { return value; },
|
|
782
|
-
});
|
|
783
|
-
};
|
|
784
605
|
return context.eventStreamMarshaller.serialize(input, eventMarshallingVisitor);
|
|
785
606
|
};
|
|
786
|
-
|
|
787
|
-
|
|
607
|
+
const serializeAws_restJson1AudioInputEvent_event = (input, context) => {
|
|
608
|
+
const headers = {
|
|
788
609
|
":event-type": { type: "string", value: "AudioInputEvent" },
|
|
789
610
|
":message-type": { type: "string", value: "event" },
|
|
790
611
|
":content-type": { type: "string", value: "application/json" },
|
|
791
612
|
};
|
|
792
|
-
|
|
613
|
+
let body = new Uint8Array();
|
|
793
614
|
body = serializeAws_restJson1AudioInputEvent(input, context);
|
|
794
615
|
body = context.utf8Decoder(JSON.stringify(body));
|
|
795
|
-
return { headers
|
|
616
|
+
return { headers, body };
|
|
796
617
|
};
|
|
797
|
-
|
|
798
|
-
|
|
618
|
+
const serializeAws_restJson1ConfigurationEvent_event = (input, context) => {
|
|
619
|
+
const headers = {
|
|
799
620
|
":event-type": { type: "string", value: "ConfigurationEvent" },
|
|
800
621
|
":message-type": { type: "string", value: "event" },
|
|
801
622
|
":content-type": { type: "string", value: "application/json" },
|
|
802
623
|
};
|
|
803
|
-
|
|
624
|
+
let body = new Uint8Array();
|
|
804
625
|
body = serializeAws_restJson1ConfigurationEvent(input, context);
|
|
805
626
|
body = context.utf8Decoder(JSON.stringify(body));
|
|
806
|
-
return { headers
|
|
627
|
+
return { headers, body };
|
|
807
628
|
};
|
|
808
|
-
|
|
809
|
-
|
|
629
|
+
const serializeAws_restJson1DisconnectionEvent_event = (input, context) => {
|
|
630
|
+
const headers = {
|
|
810
631
|
":event-type": { type: "string", value: "DisconnectionEvent" },
|
|
811
632
|
":message-type": { type: "string", value: "event" },
|
|
812
633
|
":content-type": { type: "string", value: "application/json" },
|
|
813
634
|
};
|
|
814
|
-
|
|
635
|
+
let body = new Uint8Array();
|
|
815
636
|
body = serializeAws_restJson1DisconnectionEvent(input, context);
|
|
816
637
|
body = context.utf8Decoder(JSON.stringify(body));
|
|
817
|
-
return { headers
|
|
638
|
+
return { headers, body };
|
|
818
639
|
};
|
|
819
|
-
|
|
820
|
-
|
|
640
|
+
const serializeAws_restJson1DTMFInputEvent_event = (input, context) => {
|
|
641
|
+
const headers = {
|
|
821
642
|
":event-type": { type: "string", value: "DTMFInputEvent" },
|
|
822
643
|
":message-type": { type: "string", value: "event" },
|
|
823
644
|
":content-type": { type: "string", value: "application/json" },
|
|
824
645
|
};
|
|
825
|
-
|
|
646
|
+
let body = new Uint8Array();
|
|
826
647
|
body = serializeAws_restJson1DTMFInputEvent(input, context);
|
|
827
648
|
body = context.utf8Decoder(JSON.stringify(body));
|
|
828
|
-
return { headers
|
|
649
|
+
return { headers, body };
|
|
829
650
|
};
|
|
830
|
-
|
|
831
|
-
|
|
651
|
+
const serializeAws_restJson1PlaybackCompletionEvent_event = (input, context) => {
|
|
652
|
+
const headers = {
|
|
832
653
|
":event-type": { type: "string", value: "PlaybackCompletionEvent" },
|
|
833
654
|
":message-type": { type: "string", value: "event" },
|
|
834
655
|
":content-type": { type: "string", value: "application/json" },
|
|
835
656
|
};
|
|
836
|
-
|
|
657
|
+
let body = new Uint8Array();
|
|
837
658
|
body = serializeAws_restJson1PlaybackCompletionEvent(input, context);
|
|
838
659
|
body = context.utf8Decoder(JSON.stringify(body));
|
|
839
|
-
return { headers
|
|
660
|
+
return { headers, body };
|
|
840
661
|
};
|
|
841
|
-
|
|
842
|
-
|
|
662
|
+
const serializeAws_restJson1TextInputEvent_event = (input, context) => {
|
|
663
|
+
const headers = {
|
|
843
664
|
":event-type": { type: "string", value: "TextInputEvent" },
|
|
844
665
|
":message-type": { type: "string", value: "event" },
|
|
845
666
|
":content-type": { type: "string", value: "application/json" },
|
|
846
667
|
};
|
|
847
|
-
|
|
668
|
+
let body = new Uint8Array();
|
|
848
669
|
body = serializeAws_restJson1TextInputEvent(input, context);
|
|
849
670
|
body = context.utf8Decoder(JSON.stringify(body));
|
|
850
|
-
return { headers
|
|
851
|
-
};
|
|
852
|
-
|
|
853
|
-
return context.eventStreamMarshaller.deserialize(output,
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
if (!(event["PlaybackInterruptionEvent"] != null)) return [3, 2];
|
|
859
|
-
_a = {};
|
|
860
|
-
return [4, deserializeAws_restJson1PlaybackInterruptionEvent_event(event["PlaybackInterruptionEvent"], context)];
|
|
861
|
-
case 1: return [2, (_a.PlaybackInterruptionEvent = _q.sent(),
|
|
862
|
-
_a)];
|
|
863
|
-
case 2:
|
|
864
|
-
if (!(event["TranscriptEvent"] != null)) return [3, 4];
|
|
865
|
-
_b = {};
|
|
866
|
-
return [4, deserializeAws_restJson1TranscriptEvent_event(event["TranscriptEvent"], context)];
|
|
867
|
-
case 3: return [2, (_b.TranscriptEvent = _q.sent(),
|
|
868
|
-
_b)];
|
|
869
|
-
case 4:
|
|
870
|
-
if (!(event["IntentResultEvent"] != null)) return [3, 6];
|
|
871
|
-
_c = {};
|
|
872
|
-
return [4, deserializeAws_restJson1IntentResultEvent_event(event["IntentResultEvent"], context)];
|
|
873
|
-
case 5: return [2, (_c.IntentResultEvent = _q.sent(),
|
|
874
|
-
_c)];
|
|
875
|
-
case 6:
|
|
876
|
-
if (!(event["TextResponseEvent"] != null)) return [3, 8];
|
|
877
|
-
_d = {};
|
|
878
|
-
return [4, deserializeAws_restJson1TextResponseEvent_event(event["TextResponseEvent"], context)];
|
|
879
|
-
case 7: return [2, (_d.TextResponseEvent = _q.sent(),
|
|
880
|
-
_d)];
|
|
881
|
-
case 8:
|
|
882
|
-
if (!(event["AudioResponseEvent"] != null)) return [3, 10];
|
|
883
|
-
_e = {};
|
|
884
|
-
return [4, deserializeAws_restJson1AudioResponseEvent_event(event["AudioResponseEvent"], context)];
|
|
885
|
-
case 9: return [2, (_e.AudioResponseEvent = _q.sent(),
|
|
886
|
-
_e)];
|
|
887
|
-
case 10:
|
|
888
|
-
if (!(event["HeartbeatEvent"] != null)) return [3, 12];
|
|
889
|
-
_f = {};
|
|
890
|
-
return [4, deserializeAws_restJson1HeartbeatEvent_event(event["HeartbeatEvent"], context)];
|
|
891
|
-
case 11: return [2, (_f.HeartbeatEvent = _q.sent(),
|
|
892
|
-
_f)];
|
|
893
|
-
case 12:
|
|
894
|
-
if (!(event["AccessDeniedException"] != null)) return [3, 14];
|
|
895
|
-
_g = {};
|
|
896
|
-
return [4, deserializeAws_restJson1AccessDeniedException_event(event["AccessDeniedException"], context)];
|
|
897
|
-
case 13: return [2, (_g.AccessDeniedException = _q.sent(),
|
|
898
|
-
_g)];
|
|
899
|
-
case 14:
|
|
900
|
-
if (!(event["ResourceNotFoundException"] != null)) return [3, 16];
|
|
901
|
-
_h = {};
|
|
902
|
-
return [4, deserializeAws_restJson1ResourceNotFoundException_event(event["ResourceNotFoundException"], context)];
|
|
903
|
-
case 15: return [2, (_h.ResourceNotFoundException = _q.sent(),
|
|
904
|
-
_h)];
|
|
905
|
-
case 16:
|
|
906
|
-
if (!(event["ValidationException"] != null)) return [3, 18];
|
|
907
|
-
_j = {};
|
|
908
|
-
return [4, deserializeAws_restJson1ValidationException_event(event["ValidationException"], context)];
|
|
909
|
-
case 17: return [2, (_j.ValidationException = _q.sent(),
|
|
910
|
-
_j)];
|
|
911
|
-
case 18:
|
|
912
|
-
if (!(event["ThrottlingException"] != null)) return [3, 20];
|
|
913
|
-
_k = {};
|
|
914
|
-
return [4, deserializeAws_restJson1ThrottlingException_event(event["ThrottlingException"], context)];
|
|
915
|
-
case 19: return [2, (_k.ThrottlingException = _q.sent(),
|
|
916
|
-
_k)];
|
|
917
|
-
case 20:
|
|
918
|
-
if (!(event["InternalServerException"] != null)) return [3, 22];
|
|
919
|
-
_l = {};
|
|
920
|
-
return [4, deserializeAws_restJson1InternalServerException_event(event["InternalServerException"], context)];
|
|
921
|
-
case 21: return [2, (_l.InternalServerException = _q.sent(),
|
|
922
|
-
_l)];
|
|
923
|
-
case 22:
|
|
924
|
-
if (!(event["ConflictException"] != null)) return [3, 24];
|
|
925
|
-
_m = {};
|
|
926
|
-
return [4, deserializeAws_restJson1ConflictException_event(event["ConflictException"], context)];
|
|
927
|
-
case 23: return [2, (_m.ConflictException = _q.sent(),
|
|
928
|
-
_m)];
|
|
929
|
-
case 24:
|
|
930
|
-
if (!(event["DependencyFailedException"] != null)) return [3, 26];
|
|
931
|
-
_o = {};
|
|
932
|
-
return [4, deserializeAws_restJson1DependencyFailedException_event(event["DependencyFailedException"], context)];
|
|
933
|
-
case 25: return [2, (_o.DependencyFailedException = _q.sent(),
|
|
934
|
-
_o)];
|
|
935
|
-
case 26:
|
|
936
|
-
if (!(event["BadGatewayException"] != null)) return [3, 28];
|
|
937
|
-
_p = {};
|
|
938
|
-
return [4, deserializeAws_restJson1BadGatewayException_event(event["BadGatewayException"], context)];
|
|
939
|
-
case 27: return [2, (_p.BadGatewayException = _q.sent(),
|
|
940
|
-
_p)];
|
|
941
|
-
case 28: return [2, { $unknown: output }];
|
|
942
|
-
}
|
|
943
|
-
});
|
|
944
|
-
}); });
|
|
945
|
-
};
|
|
946
|
-
var deserializeAws_restJson1AccessDeniedException_event = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
947
|
-
var parsedOutput, _a;
|
|
948
|
-
var _b;
|
|
949
|
-
return __generator(this, function (_c) {
|
|
950
|
-
switch (_c.label) {
|
|
951
|
-
case 0:
|
|
952
|
-
_a = [__assign({}, output)];
|
|
953
|
-
_b = {};
|
|
954
|
-
return [4, parseBody(output.body, context)];
|
|
955
|
-
case 1:
|
|
956
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
|
|
957
|
-
return [2, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
671
|
+
return { headers, body };
|
|
672
|
+
};
|
|
673
|
+
const deserializeAws_restJson1StartConversationResponseEventStream = (output, context) => {
|
|
674
|
+
return context.eventStreamMarshaller.deserialize(output, async (event) => {
|
|
675
|
+
if (event["PlaybackInterruptionEvent"] != null) {
|
|
676
|
+
return {
|
|
677
|
+
PlaybackInterruptionEvent: await deserializeAws_restJson1PlaybackInterruptionEvent_event(event["PlaybackInterruptionEvent"], context),
|
|
678
|
+
};
|
|
958
679
|
}
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
return __generator(this, function (_a) {
|
|
964
|
-
switch (_a.label) {
|
|
965
|
-
case 0:
|
|
966
|
-
contents = {};
|
|
967
|
-
return [4, parseBody(output.body, context)];
|
|
968
|
-
case 1:
|
|
969
|
-
data = _a.sent();
|
|
970
|
-
Object.assign(contents, deserializeAws_restJson1AudioResponseEvent(data, context));
|
|
971
|
-
return [2, contents];
|
|
680
|
+
if (event["TranscriptEvent"] != null) {
|
|
681
|
+
return {
|
|
682
|
+
TranscriptEvent: await deserializeAws_restJson1TranscriptEvent_event(event["TranscriptEvent"], context),
|
|
683
|
+
};
|
|
972
684
|
}
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
var _b;
|
|
978
|
-
return __generator(this, function (_c) {
|
|
979
|
-
switch (_c.label) {
|
|
980
|
-
case 0:
|
|
981
|
-
_a = [__assign({}, output)];
|
|
982
|
-
_b = {};
|
|
983
|
-
return [4, parseBody(output.body, context)];
|
|
984
|
-
case 1:
|
|
985
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
|
|
986
|
-
return [2, deserializeAws_restJson1BadGatewayExceptionResponse(parsedOutput, context)];
|
|
685
|
+
if (event["IntentResultEvent"] != null) {
|
|
686
|
+
return {
|
|
687
|
+
IntentResultEvent: await deserializeAws_restJson1IntentResultEvent_event(event["IntentResultEvent"], context),
|
|
688
|
+
};
|
|
987
689
|
}
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
var _b;
|
|
993
|
-
return __generator(this, function (_c) {
|
|
994
|
-
switch (_c.label) {
|
|
995
|
-
case 0:
|
|
996
|
-
_a = [__assign({}, output)];
|
|
997
|
-
_b = {};
|
|
998
|
-
return [4, parseBody(output.body, context)];
|
|
999
|
-
case 1:
|
|
1000
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
|
|
1001
|
-
return [2, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
|
|
690
|
+
if (event["TextResponseEvent"] != null) {
|
|
691
|
+
return {
|
|
692
|
+
TextResponseEvent: await deserializeAws_restJson1TextResponseEvent_event(event["TextResponseEvent"], context),
|
|
693
|
+
};
|
|
1002
694
|
}
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
var _b;
|
|
1008
|
-
return __generator(this, function (_c) {
|
|
1009
|
-
switch (_c.label) {
|
|
1010
|
-
case 0:
|
|
1011
|
-
_a = [__assign({}, output)];
|
|
1012
|
-
_b = {};
|
|
1013
|
-
return [4, parseBody(output.body, context)];
|
|
1014
|
-
case 1:
|
|
1015
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
|
|
1016
|
-
return [2, deserializeAws_restJson1DependencyFailedExceptionResponse(parsedOutput, context)];
|
|
695
|
+
if (event["AudioResponseEvent"] != null) {
|
|
696
|
+
return {
|
|
697
|
+
AudioResponseEvent: await deserializeAws_restJson1AudioResponseEvent_event(event["AudioResponseEvent"], context),
|
|
698
|
+
};
|
|
1017
699
|
}
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
return __generator(this, function (_a) {
|
|
1023
|
-
switch (_a.label) {
|
|
1024
|
-
case 0:
|
|
1025
|
-
contents = {};
|
|
1026
|
-
return [4, parseBody(output.body, context)];
|
|
1027
|
-
case 1:
|
|
1028
|
-
data = _a.sent();
|
|
1029
|
-
Object.assign(contents, deserializeAws_restJson1HeartbeatEvent(data, context));
|
|
1030
|
-
return [2, contents];
|
|
700
|
+
if (event["HeartbeatEvent"] != null) {
|
|
701
|
+
return {
|
|
702
|
+
HeartbeatEvent: await deserializeAws_restJson1HeartbeatEvent_event(event["HeartbeatEvent"], context),
|
|
703
|
+
};
|
|
1031
704
|
}
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
return __generator(this, function (_a) {
|
|
1037
|
-
switch (_a.label) {
|
|
1038
|
-
case 0:
|
|
1039
|
-
contents = {};
|
|
1040
|
-
return [4, parseBody(output.body, context)];
|
|
1041
|
-
case 1:
|
|
1042
|
-
data = _a.sent();
|
|
1043
|
-
Object.assign(contents, deserializeAws_restJson1IntentResultEvent(data, context));
|
|
1044
|
-
return [2, contents];
|
|
705
|
+
if (event["AccessDeniedException"] != null) {
|
|
706
|
+
return {
|
|
707
|
+
AccessDeniedException: await deserializeAws_restJson1AccessDeniedException_event(event["AccessDeniedException"], context),
|
|
708
|
+
};
|
|
1045
709
|
}
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
var _b;
|
|
1051
|
-
return __generator(this, function (_c) {
|
|
1052
|
-
switch (_c.label) {
|
|
1053
|
-
case 0:
|
|
1054
|
-
_a = [__assign({}, output)];
|
|
1055
|
-
_b = {};
|
|
1056
|
-
return [4, parseBody(output.body, context)];
|
|
1057
|
-
case 1:
|
|
1058
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
|
|
1059
|
-
return [2, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
710
|
+
if (event["ResourceNotFoundException"] != null) {
|
|
711
|
+
return {
|
|
712
|
+
ResourceNotFoundException: await deserializeAws_restJson1ResourceNotFoundException_event(event["ResourceNotFoundException"], context),
|
|
713
|
+
};
|
|
1060
714
|
}
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
return __generator(this, function (_a) {
|
|
1066
|
-
switch (_a.label) {
|
|
1067
|
-
case 0:
|
|
1068
|
-
contents = {};
|
|
1069
|
-
return [4, parseBody(output.body, context)];
|
|
1070
|
-
case 1:
|
|
1071
|
-
data = _a.sent();
|
|
1072
|
-
Object.assign(contents, deserializeAws_restJson1PlaybackInterruptionEvent(data, context));
|
|
1073
|
-
return [2, contents];
|
|
715
|
+
if (event["ValidationException"] != null) {
|
|
716
|
+
return {
|
|
717
|
+
ValidationException: await deserializeAws_restJson1ValidationException_event(event["ValidationException"], context),
|
|
718
|
+
};
|
|
1074
719
|
}
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
var _b;
|
|
1080
|
-
return __generator(this, function (_c) {
|
|
1081
|
-
switch (_c.label) {
|
|
1082
|
-
case 0:
|
|
1083
|
-
_a = [__assign({}, output)];
|
|
1084
|
-
_b = {};
|
|
1085
|
-
return [4, parseBody(output.body, context)];
|
|
1086
|
-
case 1:
|
|
1087
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
|
|
1088
|
-
return [2, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
720
|
+
if (event["ThrottlingException"] != null) {
|
|
721
|
+
return {
|
|
722
|
+
ThrottlingException: await deserializeAws_restJson1ThrottlingException_event(event["ThrottlingException"], context),
|
|
723
|
+
};
|
|
1089
724
|
}
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
return __generator(this, function (_a) {
|
|
1095
|
-
switch (_a.label) {
|
|
1096
|
-
case 0:
|
|
1097
|
-
contents = {};
|
|
1098
|
-
return [4, parseBody(output.body, context)];
|
|
1099
|
-
case 1:
|
|
1100
|
-
data = _a.sent();
|
|
1101
|
-
Object.assign(contents, deserializeAws_restJson1TextResponseEvent(data, context));
|
|
1102
|
-
return [2, contents];
|
|
725
|
+
if (event["InternalServerException"] != null) {
|
|
726
|
+
return {
|
|
727
|
+
InternalServerException: await deserializeAws_restJson1InternalServerException_event(event["InternalServerException"], context),
|
|
728
|
+
};
|
|
1103
729
|
}
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
var _b;
|
|
1109
|
-
return __generator(this, function (_c) {
|
|
1110
|
-
switch (_c.label) {
|
|
1111
|
-
case 0:
|
|
1112
|
-
_a = [__assign({}, output)];
|
|
1113
|
-
_b = {};
|
|
1114
|
-
return [4, parseBody(output.body, context)];
|
|
1115
|
-
case 1:
|
|
1116
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
|
|
1117
|
-
return [2, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
730
|
+
if (event["ConflictException"] != null) {
|
|
731
|
+
return {
|
|
732
|
+
ConflictException: await deserializeAws_restJson1ConflictException_event(event["ConflictException"], context),
|
|
733
|
+
};
|
|
1118
734
|
}
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
return __generator(this, function (_a) {
|
|
1124
|
-
switch (_a.label) {
|
|
1125
|
-
case 0:
|
|
1126
|
-
contents = {};
|
|
1127
|
-
return [4, parseBody(output.body, context)];
|
|
1128
|
-
case 1:
|
|
1129
|
-
data = _a.sent();
|
|
1130
|
-
Object.assign(contents, deserializeAws_restJson1TranscriptEvent(data, context));
|
|
1131
|
-
return [2, contents];
|
|
735
|
+
if (event["DependencyFailedException"] != null) {
|
|
736
|
+
return {
|
|
737
|
+
DependencyFailedException: await deserializeAws_restJson1DependencyFailedException_event(event["DependencyFailedException"], context),
|
|
738
|
+
};
|
|
1132
739
|
}
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
var _b;
|
|
1138
|
-
return __generator(this, function (_c) {
|
|
1139
|
-
switch (_c.label) {
|
|
1140
|
-
case 0:
|
|
1141
|
-
_a = [__assign({}, output)];
|
|
1142
|
-
_b = {};
|
|
1143
|
-
return [4, parseBody(output.body, context)];
|
|
1144
|
-
case 1:
|
|
1145
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
|
|
1146
|
-
return [2, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
740
|
+
if (event["BadGatewayException"] != null) {
|
|
741
|
+
return {
|
|
742
|
+
BadGatewayException: await deserializeAws_restJson1BadGatewayException_event(event["BadGatewayException"], context),
|
|
743
|
+
};
|
|
1147
744
|
}
|
|
745
|
+
return { $unknown: output };
|
|
1148
746
|
});
|
|
1149
|
-
}
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
};
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
747
|
+
};
|
|
748
|
+
const deserializeAws_restJson1AccessDeniedException_event = async (output, context) => {
|
|
749
|
+
const parsedOutput = {
|
|
750
|
+
...output,
|
|
751
|
+
body: await parseBody(output.body, context),
|
|
752
|
+
};
|
|
753
|
+
return deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
754
|
+
};
|
|
755
|
+
const deserializeAws_restJson1AudioResponseEvent_event = async (output, context) => {
|
|
756
|
+
const contents = {};
|
|
757
|
+
const data = await parseBody(output.body, context);
|
|
758
|
+
Object.assign(contents, deserializeAws_restJson1AudioResponseEvent(data, context));
|
|
759
|
+
return contents;
|
|
760
|
+
};
|
|
761
|
+
const deserializeAws_restJson1BadGatewayException_event = async (output, context) => {
|
|
762
|
+
const parsedOutput = {
|
|
763
|
+
...output,
|
|
764
|
+
body: await parseBody(output.body, context),
|
|
765
|
+
};
|
|
766
|
+
return deserializeAws_restJson1BadGatewayExceptionResponse(parsedOutput, context);
|
|
767
|
+
};
|
|
768
|
+
const deserializeAws_restJson1ConflictException_event = async (output, context) => {
|
|
769
|
+
const parsedOutput = {
|
|
770
|
+
...output,
|
|
771
|
+
body: await parseBody(output.body, context),
|
|
772
|
+
};
|
|
773
|
+
return deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
774
|
+
};
|
|
775
|
+
const deserializeAws_restJson1DependencyFailedException_event = async (output, context) => {
|
|
776
|
+
const parsedOutput = {
|
|
777
|
+
...output,
|
|
778
|
+
body: await parseBody(output.body, context),
|
|
779
|
+
};
|
|
780
|
+
return deserializeAws_restJson1DependencyFailedExceptionResponse(parsedOutput, context);
|
|
781
|
+
};
|
|
782
|
+
const deserializeAws_restJson1HeartbeatEvent_event = async (output, context) => {
|
|
783
|
+
const contents = {};
|
|
784
|
+
const data = await parseBody(output.body, context);
|
|
785
|
+
Object.assign(contents, deserializeAws_restJson1HeartbeatEvent(data, context));
|
|
786
|
+
return contents;
|
|
787
|
+
};
|
|
788
|
+
const deserializeAws_restJson1IntentResultEvent_event = async (output, context) => {
|
|
789
|
+
const contents = {};
|
|
790
|
+
const data = await parseBody(output.body, context);
|
|
791
|
+
Object.assign(contents, deserializeAws_restJson1IntentResultEvent(data, context));
|
|
792
|
+
return contents;
|
|
793
|
+
};
|
|
794
|
+
const deserializeAws_restJson1InternalServerException_event = async (output, context) => {
|
|
795
|
+
const parsedOutput = {
|
|
796
|
+
...output,
|
|
797
|
+
body: await parseBody(output.body, context),
|
|
798
|
+
};
|
|
799
|
+
return deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
800
|
+
};
|
|
801
|
+
const deserializeAws_restJson1PlaybackInterruptionEvent_event = async (output, context) => {
|
|
802
|
+
const contents = {};
|
|
803
|
+
const data = await parseBody(output.body, context);
|
|
804
|
+
Object.assign(contents, deserializeAws_restJson1PlaybackInterruptionEvent(data, context));
|
|
805
|
+
return contents;
|
|
806
|
+
};
|
|
807
|
+
const deserializeAws_restJson1ResourceNotFoundException_event = async (output, context) => {
|
|
808
|
+
const parsedOutput = {
|
|
809
|
+
...output,
|
|
810
|
+
body: await parseBody(output.body, context),
|
|
811
|
+
};
|
|
812
|
+
return deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
813
|
+
};
|
|
814
|
+
const deserializeAws_restJson1TextResponseEvent_event = async (output, context) => {
|
|
815
|
+
const contents = {};
|
|
816
|
+
const data = await parseBody(output.body, context);
|
|
817
|
+
Object.assign(contents, deserializeAws_restJson1TextResponseEvent(data, context));
|
|
818
|
+
return contents;
|
|
819
|
+
};
|
|
820
|
+
const deserializeAws_restJson1ThrottlingException_event = async (output, context) => {
|
|
821
|
+
const parsedOutput = {
|
|
822
|
+
...output,
|
|
823
|
+
body: await parseBody(output.body, context),
|
|
824
|
+
};
|
|
825
|
+
return deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
826
|
+
};
|
|
827
|
+
const deserializeAws_restJson1TranscriptEvent_event = async (output, context) => {
|
|
828
|
+
const contents = {};
|
|
829
|
+
const data = await parseBody(output.body, context);
|
|
830
|
+
Object.assign(contents, deserializeAws_restJson1TranscriptEvent(data, context));
|
|
831
|
+
return contents;
|
|
832
|
+
};
|
|
833
|
+
const deserializeAws_restJson1ValidationException_event = async (output, context) => {
|
|
834
|
+
const parsedOutput = {
|
|
835
|
+
...output,
|
|
836
|
+
body: await parseBody(output.body, context),
|
|
837
|
+
};
|
|
838
|
+
return deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
839
|
+
};
|
|
840
|
+
const serializeAws_restJson1ActiveContext = (input, context) => {
|
|
841
|
+
return {
|
|
842
|
+
...(input.contextAttributes != null && {
|
|
843
|
+
contextAttributes: serializeAws_restJson1ActiveContextParametersMap(input.contextAttributes, context),
|
|
844
|
+
}),
|
|
845
|
+
...(input.name != null && { name: input.name }),
|
|
846
|
+
...(input.timeToLive != null && {
|
|
847
|
+
timeToLive: serializeAws_restJson1ActiveContextTimeToLive(input.timeToLive, context),
|
|
848
|
+
}),
|
|
849
|
+
};
|
|
850
|
+
};
|
|
851
|
+
const serializeAws_restJson1ActiveContextParametersMap = (input, context) => {
|
|
852
|
+
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
1161
853
|
if (value === null) {
|
|
1162
854
|
return acc;
|
|
1163
855
|
}
|
|
1164
|
-
return
|
|
856
|
+
return {
|
|
857
|
+
...acc,
|
|
858
|
+
[key]: value,
|
|
859
|
+
};
|
|
1165
860
|
}, {});
|
|
1166
861
|
};
|
|
1167
|
-
|
|
862
|
+
const serializeAws_restJson1ActiveContextsList = (input, context) => {
|
|
1168
863
|
return input
|
|
1169
|
-
.filter(
|
|
1170
|
-
.map(
|
|
864
|
+
.filter((e) => e != null)
|
|
865
|
+
.map((entry) => {
|
|
1171
866
|
return serializeAws_restJson1ActiveContext(entry, context);
|
|
1172
867
|
});
|
|
1173
868
|
};
|
|
1174
|
-
|
|
1175
|
-
return
|
|
869
|
+
const serializeAws_restJson1ActiveContextTimeToLive = (input, context) => {
|
|
870
|
+
return {
|
|
871
|
+
...(input.timeToLiveInSeconds != null && { timeToLiveInSeconds: input.timeToLiveInSeconds }),
|
|
872
|
+
...(input.turnsToLive != null && { turnsToLive: input.turnsToLive }),
|
|
873
|
+
};
|
|
1176
874
|
};
|
|
1177
|
-
|
|
1178
|
-
return
|
|
875
|
+
const serializeAws_restJson1AudioInputEvent = (input, context) => {
|
|
876
|
+
return {
|
|
877
|
+
...(input.audioChunk != null && { audioChunk: context.base64Encoder(input.audioChunk) }),
|
|
878
|
+
...(input.clientTimestampMillis != null && { clientTimestampMillis: input.clientTimestampMillis }),
|
|
879
|
+
...(input.contentType != null && { contentType: input.contentType }),
|
|
880
|
+
...(input.eventId != null && { eventId: input.eventId }),
|
|
881
|
+
};
|
|
1179
882
|
};
|
|
1180
|
-
|
|
1181
|
-
return
|
|
883
|
+
const serializeAws_restJson1Button = (input, context) => {
|
|
884
|
+
return {
|
|
885
|
+
...(input.text != null && { text: input.text }),
|
|
886
|
+
...(input.value != null && { value: input.value }),
|
|
887
|
+
};
|
|
1182
888
|
};
|
|
1183
|
-
|
|
889
|
+
const serializeAws_restJson1ButtonsList = (input, context) => {
|
|
1184
890
|
return input
|
|
1185
|
-
.filter(
|
|
1186
|
-
.map(
|
|
891
|
+
.filter((e) => e != null)
|
|
892
|
+
.map((entry) => {
|
|
1187
893
|
return serializeAws_restJson1Button(entry, context);
|
|
1188
894
|
});
|
|
1189
895
|
};
|
|
1190
|
-
|
|
1191
|
-
return
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
896
|
+
const serializeAws_restJson1ConfigurationEvent = (input, context) => {
|
|
897
|
+
return {
|
|
898
|
+
...(input.clientTimestampMillis != null && { clientTimestampMillis: input.clientTimestampMillis }),
|
|
899
|
+
...(input.disablePlayback != null && { disablePlayback: input.disablePlayback }),
|
|
900
|
+
...(input.eventId != null && { eventId: input.eventId }),
|
|
901
|
+
...(input.requestAttributes != null && {
|
|
902
|
+
requestAttributes: serializeAws_restJson1StringMap(input.requestAttributes, context),
|
|
903
|
+
}),
|
|
904
|
+
...(input.responseContentType != null && { responseContentType: input.responseContentType }),
|
|
905
|
+
...(input.sessionState != null && {
|
|
906
|
+
sessionState: serializeAws_restJson1SessionState(input.sessionState, context),
|
|
907
|
+
}),
|
|
908
|
+
...(input.welcomeMessages != null && {
|
|
909
|
+
welcomeMessages: serializeAws_restJson1Messages(input.welcomeMessages, context),
|
|
910
|
+
}),
|
|
911
|
+
};
|
|
1198
912
|
};
|
|
1199
|
-
|
|
1200
|
-
return
|
|
1201
|
-
|
|
1202
|
-
|
|
913
|
+
const serializeAws_restJson1DialogAction = (input, context) => {
|
|
914
|
+
return {
|
|
915
|
+
...(input.slotElicitationStyle != null && { slotElicitationStyle: input.slotElicitationStyle }),
|
|
916
|
+
...(input.slotToElicit != null && { slotToElicit: input.slotToElicit }),
|
|
917
|
+
...(input.subSlotToElicit != null && {
|
|
918
|
+
subSlotToElicit: serializeAws_restJson1ElicitSubSlot(input.subSlotToElicit, context),
|
|
919
|
+
}),
|
|
920
|
+
...(input.type != null && { type: input.type }),
|
|
921
|
+
};
|
|
1203
922
|
};
|
|
1204
|
-
|
|
1205
|
-
return
|
|
923
|
+
const serializeAws_restJson1DisconnectionEvent = (input, context) => {
|
|
924
|
+
return {
|
|
925
|
+
...(input.clientTimestampMillis != null && { clientTimestampMillis: input.clientTimestampMillis }),
|
|
926
|
+
...(input.eventId != null && { eventId: input.eventId }),
|
|
927
|
+
};
|
|
1206
928
|
};
|
|
1207
|
-
|
|
1208
|
-
return
|
|
929
|
+
const serializeAws_restJson1DTMFInputEvent = (input, context) => {
|
|
930
|
+
return {
|
|
931
|
+
...(input.clientTimestampMillis != null && { clientTimestampMillis: input.clientTimestampMillis }),
|
|
932
|
+
...(input.eventId != null && { eventId: input.eventId }),
|
|
933
|
+
...(input.inputCharacter != null && { inputCharacter: input.inputCharacter }),
|
|
934
|
+
};
|
|
1209
935
|
};
|
|
1210
|
-
|
|
1211
|
-
return
|
|
1212
|
-
|
|
1213
|
-
|
|
936
|
+
const serializeAws_restJson1ElicitSubSlot = (input, context) => {
|
|
937
|
+
return {
|
|
938
|
+
...(input.name != null && { name: input.name }),
|
|
939
|
+
...(input.subSlotToElicit != null && {
|
|
940
|
+
subSlotToElicit: serializeAws_restJson1ElicitSubSlot(input.subSlotToElicit, context),
|
|
941
|
+
}),
|
|
942
|
+
};
|
|
1214
943
|
};
|
|
1215
|
-
|
|
1216
|
-
return
|
|
944
|
+
const serializeAws_restJson1ImageResponseCard = (input, context) => {
|
|
945
|
+
return {
|
|
946
|
+
...(input.buttons != null && { buttons: serializeAws_restJson1ButtonsList(input.buttons, context) }),
|
|
947
|
+
...(input.imageUrl != null && { imageUrl: input.imageUrl }),
|
|
948
|
+
...(input.subtitle != null && { subtitle: input.subtitle }),
|
|
949
|
+
...(input.title != null && { title: input.title }),
|
|
950
|
+
};
|
|
1217
951
|
};
|
|
1218
|
-
|
|
1219
|
-
return
|
|
952
|
+
const serializeAws_restJson1Intent = (input, context) => {
|
|
953
|
+
return {
|
|
954
|
+
...(input.confirmationState != null && { confirmationState: input.confirmationState }),
|
|
955
|
+
...(input.name != null && { name: input.name }),
|
|
956
|
+
...(input.slots != null && { slots: serializeAws_restJson1Slots(input.slots, context) }),
|
|
957
|
+
...(input.state != null && { state: input.state }),
|
|
958
|
+
};
|
|
1220
959
|
};
|
|
1221
|
-
|
|
1222
|
-
return
|
|
1223
|
-
|
|
1224
|
-
|
|
960
|
+
const serializeAws_restJson1Message = (input, context) => {
|
|
961
|
+
return {
|
|
962
|
+
...(input.content != null && { content: input.content }),
|
|
963
|
+
...(input.contentType != null && { contentType: input.contentType }),
|
|
964
|
+
...(input.imageResponseCard != null && {
|
|
965
|
+
imageResponseCard: serializeAws_restJson1ImageResponseCard(input.imageResponseCard, context),
|
|
966
|
+
}),
|
|
967
|
+
};
|
|
1225
968
|
};
|
|
1226
|
-
|
|
969
|
+
const serializeAws_restJson1Messages = (input, context) => {
|
|
1227
970
|
return input
|
|
1228
|
-
.filter(
|
|
1229
|
-
.map(
|
|
971
|
+
.filter((e) => e != null)
|
|
972
|
+
.map((entry) => {
|
|
1230
973
|
return serializeAws_restJson1Message(entry, context);
|
|
1231
974
|
});
|
|
1232
975
|
};
|
|
1233
|
-
|
|
1234
|
-
return
|
|
976
|
+
const serializeAws_restJson1PlaybackCompletionEvent = (input, context) => {
|
|
977
|
+
return {
|
|
978
|
+
...(input.clientTimestampMillis != null && { clientTimestampMillis: input.clientTimestampMillis }),
|
|
979
|
+
...(input.eventId != null && { eventId: input.eventId }),
|
|
980
|
+
};
|
|
1235
981
|
};
|
|
1236
|
-
|
|
1237
|
-
return
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
982
|
+
const serializeAws_restJson1RuntimeHintDetails = (input, context) => {
|
|
983
|
+
return {
|
|
984
|
+
...(input.runtimeHintValues != null && {
|
|
985
|
+
runtimeHintValues: serializeAws_restJson1RuntimeHintValuesList(input.runtimeHintValues, context),
|
|
986
|
+
}),
|
|
987
|
+
...(input.subSlotHints != null && {
|
|
988
|
+
subSlotHints: serializeAws_restJson1SlotHintsSlotMap(input.subSlotHints, context),
|
|
989
|
+
}),
|
|
990
|
+
};
|
|
1242
991
|
};
|
|
1243
|
-
|
|
1244
|
-
return
|
|
992
|
+
const serializeAws_restJson1RuntimeHints = (input, context) => {
|
|
993
|
+
return {
|
|
994
|
+
...(input.slotHints != null && { slotHints: serializeAws_restJson1SlotHintsIntentMap(input.slotHints, context) }),
|
|
995
|
+
};
|
|
1245
996
|
};
|
|
1246
|
-
|
|
1247
|
-
return
|
|
997
|
+
const serializeAws_restJson1RuntimeHintValue = (input, context) => {
|
|
998
|
+
return {
|
|
999
|
+
...(input.phrase != null && { phrase: input.phrase }),
|
|
1000
|
+
};
|
|
1248
1001
|
};
|
|
1249
|
-
|
|
1002
|
+
const serializeAws_restJson1RuntimeHintValuesList = (input, context) => {
|
|
1250
1003
|
return input
|
|
1251
|
-
.filter(
|
|
1252
|
-
.map(
|
|
1004
|
+
.filter((e) => e != null)
|
|
1005
|
+
.map((entry) => {
|
|
1253
1006
|
return serializeAws_restJson1RuntimeHintValue(entry, context);
|
|
1254
1007
|
});
|
|
1255
1008
|
};
|
|
1256
|
-
|
|
1257
|
-
return
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1009
|
+
const serializeAws_restJson1SessionState = (input, context) => {
|
|
1010
|
+
return {
|
|
1011
|
+
...(input.activeContexts != null && {
|
|
1012
|
+
activeContexts: serializeAws_restJson1ActiveContextsList(input.activeContexts, context),
|
|
1013
|
+
}),
|
|
1014
|
+
...(input.dialogAction != null && {
|
|
1015
|
+
dialogAction: serializeAws_restJson1DialogAction(input.dialogAction, context),
|
|
1016
|
+
}),
|
|
1017
|
+
...(input.intent != null && { intent: serializeAws_restJson1Intent(input.intent, context) }),
|
|
1018
|
+
...(input.originatingRequestId != null && { originatingRequestId: input.originatingRequestId }),
|
|
1019
|
+
...(input.runtimeHints != null && {
|
|
1020
|
+
runtimeHints: serializeAws_restJson1RuntimeHints(input.runtimeHints, context),
|
|
1021
|
+
}),
|
|
1022
|
+
...(input.sessionAttributes != null && {
|
|
1023
|
+
sessionAttributes: serializeAws_restJson1StringMap(input.sessionAttributes, context),
|
|
1024
|
+
}),
|
|
1025
|
+
};
|
|
1026
|
+
};
|
|
1027
|
+
const serializeAws_restJson1Slot = (input, context) => {
|
|
1028
|
+
return {
|
|
1029
|
+
...(input.shape != null && { shape: input.shape }),
|
|
1030
|
+
...(input.subSlots != null && { subSlots: serializeAws_restJson1Slots(input.subSlots, context) }),
|
|
1031
|
+
...(input.value != null && { value: serializeAws_restJson1Value(input.value, context) }),
|
|
1032
|
+
...(input.values != null && { values: serializeAws_restJson1Values(input.values, context) }),
|
|
1033
|
+
};
|
|
1034
|
+
};
|
|
1035
|
+
const serializeAws_restJson1SlotHintsIntentMap = (input, context) => {
|
|
1036
|
+
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
1274
1037
|
if (value === null) {
|
|
1275
1038
|
return acc;
|
|
1276
1039
|
}
|
|
1277
|
-
return
|
|
1040
|
+
return {
|
|
1041
|
+
...acc,
|
|
1042
|
+
[key]: serializeAws_restJson1SlotHintsSlotMap(value, context),
|
|
1043
|
+
};
|
|
1278
1044
|
}, {});
|
|
1279
1045
|
};
|
|
1280
|
-
|
|
1281
|
-
return Object.entries(input).reduce(
|
|
1282
|
-
var _b;
|
|
1283
|
-
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
1046
|
+
const serializeAws_restJson1SlotHintsSlotMap = (input, context) => {
|
|
1047
|
+
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
1284
1048
|
if (value === null) {
|
|
1285
1049
|
return acc;
|
|
1286
1050
|
}
|
|
1287
|
-
return
|
|
1051
|
+
return {
|
|
1052
|
+
...acc,
|
|
1053
|
+
[key]: serializeAws_restJson1RuntimeHintDetails(value, context),
|
|
1054
|
+
};
|
|
1288
1055
|
}, {});
|
|
1289
1056
|
};
|
|
1290
|
-
|
|
1291
|
-
return Object.entries(input).reduce(
|
|
1292
|
-
var _b;
|
|
1293
|
-
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
1057
|
+
const serializeAws_restJson1Slots = (input, context) => {
|
|
1058
|
+
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
1294
1059
|
if (value === null) {
|
|
1295
1060
|
return acc;
|
|
1296
1061
|
}
|
|
1297
|
-
return
|
|
1062
|
+
return {
|
|
1063
|
+
...acc,
|
|
1064
|
+
[key]: serializeAws_restJson1Slot(value, context),
|
|
1065
|
+
};
|
|
1298
1066
|
}, {});
|
|
1299
1067
|
};
|
|
1300
|
-
|
|
1068
|
+
const serializeAws_restJson1StringList = (input, context) => {
|
|
1301
1069
|
return input
|
|
1302
|
-
.filter(
|
|
1303
|
-
.map(
|
|
1070
|
+
.filter((e) => e != null)
|
|
1071
|
+
.map((entry) => {
|
|
1304
1072
|
return entry;
|
|
1305
1073
|
});
|
|
1306
1074
|
};
|
|
1307
|
-
|
|
1308
|
-
return Object.entries(input).reduce(
|
|
1309
|
-
var _b;
|
|
1310
|
-
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
1075
|
+
const serializeAws_restJson1StringMap = (input, context) => {
|
|
1076
|
+
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
1311
1077
|
if (value === null) {
|
|
1312
1078
|
return acc;
|
|
1313
1079
|
}
|
|
1314
|
-
return
|
|
1080
|
+
return {
|
|
1081
|
+
...acc,
|
|
1082
|
+
[key]: value,
|
|
1083
|
+
};
|
|
1315
1084
|
}, {});
|
|
1316
1085
|
};
|
|
1317
|
-
|
|
1318
|
-
return
|
|
1086
|
+
const serializeAws_restJson1TextInputEvent = (input, context) => {
|
|
1087
|
+
return {
|
|
1088
|
+
...(input.clientTimestampMillis != null && { clientTimestampMillis: input.clientTimestampMillis }),
|
|
1089
|
+
...(input.eventId != null && { eventId: input.eventId }),
|
|
1090
|
+
...(input.text != null && { text: input.text }),
|
|
1091
|
+
};
|
|
1319
1092
|
};
|
|
1320
|
-
|
|
1321
|
-
return
|
|
1322
|
-
|
|
1323
|
-
|
|
1093
|
+
const serializeAws_restJson1Value = (input, context) => {
|
|
1094
|
+
return {
|
|
1095
|
+
...(input.interpretedValue != null && { interpretedValue: input.interpretedValue }),
|
|
1096
|
+
...(input.originalValue != null && { originalValue: input.originalValue }),
|
|
1097
|
+
...(input.resolvedValues != null && {
|
|
1098
|
+
resolvedValues: serializeAws_restJson1StringList(input.resolvedValues, context),
|
|
1099
|
+
}),
|
|
1100
|
+
};
|
|
1324
1101
|
};
|
|
1325
|
-
|
|
1102
|
+
const serializeAws_restJson1Values = (input, context) => {
|
|
1326
1103
|
return input
|
|
1327
|
-
.filter(
|
|
1328
|
-
.map(
|
|
1104
|
+
.filter((e) => e != null)
|
|
1105
|
+
.map((entry) => {
|
|
1329
1106
|
return serializeAws_restJson1Slot(entry, context);
|
|
1330
1107
|
});
|
|
1331
1108
|
};
|
|
1332
|
-
|
|
1109
|
+
const deserializeAws_restJson1ActiveContext = (output, context) => {
|
|
1333
1110
|
return {
|
|
1334
1111
|
contextAttributes: output.contextAttributes != null
|
|
1335
1112
|
? deserializeAws_restJson1ActiveContextParametersMap(output.contextAttributes, context)
|
|
@@ -1340,20 +1117,21 @@ var deserializeAws_restJson1ActiveContext = function (output, context) {
|
|
|
1340
1117
|
: undefined,
|
|
1341
1118
|
};
|
|
1342
1119
|
};
|
|
1343
|
-
|
|
1344
|
-
return Object.entries(output).reduce(
|
|
1345
|
-
var _b;
|
|
1346
|
-
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
1120
|
+
const deserializeAws_restJson1ActiveContextParametersMap = (output, context) => {
|
|
1121
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
1347
1122
|
if (value === null) {
|
|
1348
1123
|
return acc;
|
|
1349
1124
|
}
|
|
1350
|
-
return
|
|
1125
|
+
return {
|
|
1126
|
+
...acc,
|
|
1127
|
+
[key]: __expectString(value),
|
|
1128
|
+
};
|
|
1351
1129
|
}, {});
|
|
1352
1130
|
};
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
.filter(
|
|
1356
|
-
.map(
|
|
1131
|
+
const deserializeAws_restJson1ActiveContextsList = (output, context) => {
|
|
1132
|
+
const retVal = (output || [])
|
|
1133
|
+
.filter((e) => e != null)
|
|
1134
|
+
.map((entry) => {
|
|
1357
1135
|
if (entry === null) {
|
|
1358
1136
|
return null;
|
|
1359
1137
|
}
|
|
@@ -1361,29 +1139,29 @@ var deserializeAws_restJson1ActiveContextsList = function (output, context) {
|
|
|
1361
1139
|
});
|
|
1362
1140
|
return retVal;
|
|
1363
1141
|
};
|
|
1364
|
-
|
|
1142
|
+
const deserializeAws_restJson1ActiveContextTimeToLive = (output, context) => {
|
|
1365
1143
|
return {
|
|
1366
1144
|
timeToLiveInSeconds: __expectInt32(output.timeToLiveInSeconds),
|
|
1367
1145
|
turnsToLive: __expectInt32(output.turnsToLive),
|
|
1368
1146
|
};
|
|
1369
1147
|
};
|
|
1370
|
-
|
|
1148
|
+
const deserializeAws_restJson1AudioResponseEvent = (output, context) => {
|
|
1371
1149
|
return {
|
|
1372
1150
|
audioChunk: output.audioChunk != null ? context.base64Decoder(output.audioChunk) : undefined,
|
|
1373
1151
|
contentType: __expectString(output.contentType),
|
|
1374
1152
|
eventId: __expectString(output.eventId),
|
|
1375
1153
|
};
|
|
1376
1154
|
};
|
|
1377
|
-
|
|
1155
|
+
const deserializeAws_restJson1Button = (output, context) => {
|
|
1378
1156
|
return {
|
|
1379
1157
|
text: __expectString(output.text),
|
|
1380
1158
|
value: __expectString(output.value),
|
|
1381
1159
|
};
|
|
1382
1160
|
};
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
.filter(
|
|
1386
|
-
.map(
|
|
1161
|
+
const deserializeAws_restJson1ButtonsList = (output, context) => {
|
|
1162
|
+
const retVal = (output || [])
|
|
1163
|
+
.filter((e) => e != null)
|
|
1164
|
+
.map((entry) => {
|
|
1387
1165
|
if (entry === null) {
|
|
1388
1166
|
return null;
|
|
1389
1167
|
}
|
|
@@ -1391,12 +1169,12 @@ var deserializeAws_restJson1ButtonsList = function (output, context) {
|
|
|
1391
1169
|
});
|
|
1392
1170
|
return retVal;
|
|
1393
1171
|
};
|
|
1394
|
-
|
|
1172
|
+
const deserializeAws_restJson1ConfidenceScore = (output, context) => {
|
|
1395
1173
|
return {
|
|
1396
1174
|
score: __limitedParseDouble(output.score),
|
|
1397
1175
|
};
|
|
1398
1176
|
};
|
|
1399
|
-
|
|
1177
|
+
const deserializeAws_restJson1DialogAction = (output, context) => {
|
|
1400
1178
|
return {
|
|
1401
1179
|
slotElicitationStyle: __expectString(output.slotElicitationStyle),
|
|
1402
1180
|
slotToElicit: __expectString(output.slotToElicit),
|
|
@@ -1406,7 +1184,7 @@ var deserializeAws_restJson1DialogAction = function (output, context) {
|
|
|
1406
1184
|
type: __expectString(output.type),
|
|
1407
1185
|
};
|
|
1408
1186
|
};
|
|
1409
|
-
|
|
1187
|
+
const deserializeAws_restJson1ElicitSubSlot = (output, context) => {
|
|
1410
1188
|
return {
|
|
1411
1189
|
name: __expectString(output.name),
|
|
1412
1190
|
subSlotToElicit: output.subSlotToElicit != null
|
|
@@ -1414,12 +1192,12 @@ var deserializeAws_restJson1ElicitSubSlot = function (output, context) {
|
|
|
1414
1192
|
: undefined,
|
|
1415
1193
|
};
|
|
1416
1194
|
};
|
|
1417
|
-
|
|
1195
|
+
const deserializeAws_restJson1HeartbeatEvent = (output, context) => {
|
|
1418
1196
|
return {
|
|
1419
1197
|
eventId: __expectString(output.eventId),
|
|
1420
1198
|
};
|
|
1421
1199
|
};
|
|
1422
|
-
|
|
1200
|
+
const deserializeAws_restJson1ImageResponseCard = (output, context) => {
|
|
1423
1201
|
return {
|
|
1424
1202
|
buttons: output.buttons != null ? deserializeAws_restJson1ButtonsList(output.buttons, context) : undefined,
|
|
1425
1203
|
imageUrl: __expectString(output.imageUrl),
|
|
@@ -1427,7 +1205,7 @@ var deserializeAws_restJson1ImageResponseCard = function (output, context) {
|
|
|
1427
1205
|
title: __expectString(output.title),
|
|
1428
1206
|
};
|
|
1429
1207
|
};
|
|
1430
|
-
|
|
1208
|
+
const deserializeAws_restJson1Intent = (output, context) => {
|
|
1431
1209
|
return {
|
|
1432
1210
|
confirmationState: __expectString(output.confirmationState),
|
|
1433
1211
|
name: __expectString(output.name),
|
|
@@ -1435,7 +1213,7 @@ var deserializeAws_restJson1Intent = function (output, context) {
|
|
|
1435
1213
|
state: __expectString(output.state),
|
|
1436
1214
|
};
|
|
1437
1215
|
};
|
|
1438
|
-
|
|
1216
|
+
const deserializeAws_restJson1IntentResultEvent = (output, context) => {
|
|
1439
1217
|
return {
|
|
1440
1218
|
eventId: __expectString(output.eventId),
|
|
1441
1219
|
inputMode: __expectString(output.inputMode),
|
|
@@ -1449,7 +1227,7 @@ var deserializeAws_restJson1IntentResultEvent = function (output, context) {
|
|
|
1449
1227
|
sessionState: output.sessionState != null ? deserializeAws_restJson1SessionState(output.sessionState, context) : undefined,
|
|
1450
1228
|
};
|
|
1451
1229
|
};
|
|
1452
|
-
|
|
1230
|
+
const deserializeAws_restJson1Interpretation = (output, context) => {
|
|
1453
1231
|
return {
|
|
1454
1232
|
intent: output.intent != null ? deserializeAws_restJson1Intent(output.intent, context) : undefined,
|
|
1455
1233
|
nluConfidence: output.nluConfidence != null ? deserializeAws_restJson1ConfidenceScore(output.nluConfidence, context) : undefined,
|
|
@@ -1458,10 +1236,10 @@ var deserializeAws_restJson1Interpretation = function (output, context) {
|
|
|
1458
1236
|
: undefined,
|
|
1459
1237
|
};
|
|
1460
1238
|
};
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
.filter(
|
|
1464
|
-
.map(
|
|
1239
|
+
const deserializeAws_restJson1Interpretations = (output, context) => {
|
|
1240
|
+
const retVal = (output || [])
|
|
1241
|
+
.filter((e) => e != null)
|
|
1242
|
+
.map((entry) => {
|
|
1465
1243
|
if (entry === null) {
|
|
1466
1244
|
return null;
|
|
1467
1245
|
}
|
|
@@ -1469,7 +1247,7 @@ var deserializeAws_restJson1Interpretations = function (output, context) {
|
|
|
1469
1247
|
});
|
|
1470
1248
|
return retVal;
|
|
1471
1249
|
};
|
|
1472
|
-
|
|
1250
|
+
const deserializeAws_restJson1Message = (output, context) => {
|
|
1473
1251
|
return {
|
|
1474
1252
|
content: __expectString(output.content),
|
|
1475
1253
|
contentType: __expectString(output.contentType),
|
|
@@ -1478,10 +1256,10 @@ var deserializeAws_restJson1Message = function (output, context) {
|
|
|
1478
1256
|
: undefined,
|
|
1479
1257
|
};
|
|
1480
1258
|
};
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
.filter(
|
|
1484
|
-
.map(
|
|
1259
|
+
const deserializeAws_restJson1Messages = (output, context) => {
|
|
1260
|
+
const retVal = (output || [])
|
|
1261
|
+
.filter((e) => e != null)
|
|
1262
|
+
.map((entry) => {
|
|
1485
1263
|
if (entry === null) {
|
|
1486
1264
|
return null;
|
|
1487
1265
|
}
|
|
@@ -1489,14 +1267,14 @@ var deserializeAws_restJson1Messages = function (output, context) {
|
|
|
1489
1267
|
});
|
|
1490
1268
|
return retVal;
|
|
1491
1269
|
};
|
|
1492
|
-
|
|
1270
|
+
const deserializeAws_restJson1PlaybackInterruptionEvent = (output, context) => {
|
|
1493
1271
|
return {
|
|
1494
1272
|
causedByEventId: __expectString(output.causedByEventId),
|
|
1495
1273
|
eventId: __expectString(output.eventId),
|
|
1496
1274
|
eventReason: __expectString(output.eventReason),
|
|
1497
1275
|
};
|
|
1498
1276
|
};
|
|
1499
|
-
|
|
1277
|
+
const deserializeAws_restJson1RuntimeHintDetails = (output, context) => {
|
|
1500
1278
|
return {
|
|
1501
1279
|
runtimeHintValues: output.runtimeHintValues != null
|
|
1502
1280
|
? deserializeAws_restJson1RuntimeHintValuesList(output.runtimeHintValues, context)
|
|
@@ -1504,20 +1282,20 @@ var deserializeAws_restJson1RuntimeHintDetails = function (output, context) {
|
|
|
1504
1282
|
subSlotHints: output.subSlotHints != null ? deserializeAws_restJson1SlotHintsSlotMap(output.subSlotHints, context) : undefined,
|
|
1505
1283
|
};
|
|
1506
1284
|
};
|
|
1507
|
-
|
|
1285
|
+
const deserializeAws_restJson1RuntimeHints = (output, context) => {
|
|
1508
1286
|
return {
|
|
1509
1287
|
slotHints: output.slotHints != null ? deserializeAws_restJson1SlotHintsIntentMap(output.slotHints, context) : undefined,
|
|
1510
1288
|
};
|
|
1511
1289
|
};
|
|
1512
|
-
|
|
1290
|
+
const deserializeAws_restJson1RuntimeHintValue = (output, context) => {
|
|
1513
1291
|
return {
|
|
1514
1292
|
phrase: __expectString(output.phrase),
|
|
1515
1293
|
};
|
|
1516
1294
|
};
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
.filter(
|
|
1520
|
-
.map(
|
|
1295
|
+
const deserializeAws_restJson1RuntimeHintValuesList = (output, context) => {
|
|
1296
|
+
const retVal = (output || [])
|
|
1297
|
+
.filter((e) => e != null)
|
|
1298
|
+
.map((entry) => {
|
|
1521
1299
|
if (entry === null) {
|
|
1522
1300
|
return null;
|
|
1523
1301
|
}
|
|
@@ -1525,7 +1303,7 @@ var deserializeAws_restJson1RuntimeHintValuesList = function (output, context) {
|
|
|
1525
1303
|
});
|
|
1526
1304
|
return retVal;
|
|
1527
1305
|
};
|
|
1528
|
-
|
|
1306
|
+
const deserializeAws_restJson1SentimentResponse = (output, context) => {
|
|
1529
1307
|
return {
|
|
1530
1308
|
sentiment: __expectString(output.sentiment),
|
|
1531
1309
|
sentimentScore: output.sentimentScore != null
|
|
@@ -1533,7 +1311,7 @@ var deserializeAws_restJson1SentimentResponse = function (output, context) {
|
|
|
1533
1311
|
: undefined,
|
|
1534
1312
|
};
|
|
1535
1313
|
};
|
|
1536
|
-
|
|
1314
|
+
const deserializeAws_restJson1SentimentScore = (output, context) => {
|
|
1537
1315
|
return {
|
|
1538
1316
|
mixed: __limitedParseDouble(output.mixed),
|
|
1539
1317
|
negative: __limitedParseDouble(output.negative),
|
|
@@ -1541,7 +1319,7 @@ var deserializeAws_restJson1SentimentScore = function (output, context) {
|
|
|
1541
1319
|
positive: __limitedParseDouble(output.positive),
|
|
1542
1320
|
};
|
|
1543
1321
|
};
|
|
1544
|
-
|
|
1322
|
+
const deserializeAws_restJson1SessionState = (output, context) => {
|
|
1545
1323
|
return {
|
|
1546
1324
|
activeContexts: output.activeContexts != null
|
|
1547
1325
|
? deserializeAws_restJson1ActiveContextsList(output.activeContexts, context)
|
|
@@ -1555,7 +1333,7 @@ var deserializeAws_restJson1SessionState = function (output, context) {
|
|
|
1555
1333
|
: undefined,
|
|
1556
1334
|
};
|
|
1557
1335
|
};
|
|
1558
|
-
|
|
1336
|
+
const deserializeAws_restJson1Slot = (output, context) => {
|
|
1559
1337
|
return {
|
|
1560
1338
|
shape: __expectString(output.shape),
|
|
1561
1339
|
subSlots: output.subSlots != null ? deserializeAws_restJson1Slots(output.subSlots, context) : undefined,
|
|
@@ -1563,40 +1341,43 @@ var deserializeAws_restJson1Slot = function (output, context) {
|
|
|
1563
1341
|
values: output.values != null ? deserializeAws_restJson1Values(output.values, context) : undefined,
|
|
1564
1342
|
};
|
|
1565
1343
|
};
|
|
1566
|
-
|
|
1567
|
-
return Object.entries(output).reduce(
|
|
1568
|
-
var _b;
|
|
1569
|
-
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
1344
|
+
const deserializeAws_restJson1SlotHintsIntentMap = (output, context) => {
|
|
1345
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
1570
1346
|
if (value === null) {
|
|
1571
1347
|
return acc;
|
|
1572
1348
|
}
|
|
1573
|
-
return
|
|
1349
|
+
return {
|
|
1350
|
+
...acc,
|
|
1351
|
+
[key]: deserializeAws_restJson1SlotHintsSlotMap(value, context),
|
|
1352
|
+
};
|
|
1574
1353
|
}, {});
|
|
1575
1354
|
};
|
|
1576
|
-
|
|
1577
|
-
return Object.entries(output).reduce(
|
|
1578
|
-
var _b;
|
|
1579
|
-
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
1355
|
+
const deserializeAws_restJson1SlotHintsSlotMap = (output, context) => {
|
|
1356
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
1580
1357
|
if (value === null) {
|
|
1581
1358
|
return acc;
|
|
1582
1359
|
}
|
|
1583
|
-
return
|
|
1360
|
+
return {
|
|
1361
|
+
...acc,
|
|
1362
|
+
[key]: deserializeAws_restJson1RuntimeHintDetails(value, context),
|
|
1363
|
+
};
|
|
1584
1364
|
}, {});
|
|
1585
1365
|
};
|
|
1586
|
-
|
|
1587
|
-
return Object.entries(output).reduce(
|
|
1588
|
-
var _b;
|
|
1589
|
-
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
1366
|
+
const deserializeAws_restJson1Slots = (output, context) => {
|
|
1367
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
1590
1368
|
if (value === null) {
|
|
1591
1369
|
return acc;
|
|
1592
1370
|
}
|
|
1593
|
-
return
|
|
1371
|
+
return {
|
|
1372
|
+
...acc,
|
|
1373
|
+
[key]: deserializeAws_restJson1Slot(value, context),
|
|
1374
|
+
};
|
|
1594
1375
|
}, {});
|
|
1595
1376
|
};
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
.filter(
|
|
1599
|
-
.map(
|
|
1377
|
+
const deserializeAws_restJson1StringList = (output, context) => {
|
|
1378
|
+
const retVal = (output || [])
|
|
1379
|
+
.filter((e) => e != null)
|
|
1380
|
+
.map((entry) => {
|
|
1600
1381
|
if (entry === null) {
|
|
1601
1382
|
return null;
|
|
1602
1383
|
}
|
|
@@ -1604,39 +1385,40 @@ var deserializeAws_restJson1StringList = function (output, context) {
|
|
|
1604
1385
|
});
|
|
1605
1386
|
return retVal;
|
|
1606
1387
|
};
|
|
1607
|
-
|
|
1608
|
-
return Object.entries(output).reduce(
|
|
1609
|
-
var _b;
|
|
1610
|
-
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
1388
|
+
const deserializeAws_restJson1StringMap = (output, context) => {
|
|
1389
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
1611
1390
|
if (value === null) {
|
|
1612
1391
|
return acc;
|
|
1613
1392
|
}
|
|
1614
|
-
return
|
|
1393
|
+
return {
|
|
1394
|
+
...acc,
|
|
1395
|
+
[key]: __expectString(value),
|
|
1396
|
+
};
|
|
1615
1397
|
}, {});
|
|
1616
1398
|
};
|
|
1617
|
-
|
|
1399
|
+
const deserializeAws_restJson1TextResponseEvent = (output, context) => {
|
|
1618
1400
|
return {
|
|
1619
1401
|
eventId: __expectString(output.eventId),
|
|
1620
1402
|
messages: output.messages != null ? deserializeAws_restJson1Messages(output.messages, context) : undefined,
|
|
1621
1403
|
};
|
|
1622
1404
|
};
|
|
1623
|
-
|
|
1405
|
+
const deserializeAws_restJson1TranscriptEvent = (output, context) => {
|
|
1624
1406
|
return {
|
|
1625
1407
|
eventId: __expectString(output.eventId),
|
|
1626
1408
|
transcript: __expectString(output.transcript),
|
|
1627
1409
|
};
|
|
1628
1410
|
};
|
|
1629
|
-
|
|
1411
|
+
const deserializeAws_restJson1Value = (output, context) => {
|
|
1630
1412
|
return {
|
|
1631
1413
|
interpretedValue: __expectString(output.interpretedValue),
|
|
1632
1414
|
originalValue: __expectString(output.originalValue),
|
|
1633
1415
|
resolvedValues: output.resolvedValues != null ? deserializeAws_restJson1StringList(output.resolvedValues, context) : undefined,
|
|
1634
1416
|
};
|
|
1635
1417
|
};
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
.filter(
|
|
1639
|
-
.map(
|
|
1418
|
+
const deserializeAws_restJson1Values = (output, context) => {
|
|
1419
|
+
const retVal = (output || [])
|
|
1420
|
+
.filter((e) => e != null)
|
|
1421
|
+
.map((entry) => {
|
|
1640
1422
|
if (entry === null) {
|
|
1641
1423
|
return null;
|
|
1642
1424
|
}
|
|
@@ -1644,57 +1426,39 @@ var deserializeAws_restJson1Values = function (output, context) {
|
|
|
1644
1426
|
});
|
|
1645
1427
|
return retVal;
|
|
1646
1428
|
};
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
});
|
|
1655
|
-
};
|
|
1656
|
-
var collectBody = function (streamBody, context) {
|
|
1657
|
-
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
1429
|
+
const deserializeMetadata = (output) => ({
|
|
1430
|
+
httpStatusCode: output.statusCode,
|
|
1431
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
1432
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
1433
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
1434
|
+
});
|
|
1435
|
+
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
1658
1436
|
if (streamBody instanceof Uint8Array) {
|
|
1659
1437
|
return Promise.resolve(streamBody);
|
|
1660
1438
|
}
|
|
1661
1439
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
1662
1440
|
};
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
}
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
return __generator(this, function (_b) {
|
|
1685
|
-
switch (_b.label) {
|
|
1686
|
-
case 0: return [4, parseBody(errorBody, context)];
|
|
1687
|
-
case 1:
|
|
1688
|
-
value = _b.sent();
|
|
1689
|
-
value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
|
|
1690
|
-
return [2, value];
|
|
1691
|
-
}
|
|
1692
|
-
});
|
|
1693
|
-
}); };
|
|
1694
|
-
var loadRestJsonErrorCode = function (output, data) {
|
|
1695
|
-
var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
|
|
1696
|
-
var sanitizeErrorCode = function (rawValue) {
|
|
1697
|
-
var cleanValue = rawValue;
|
|
1441
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
1442
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
1443
|
+
value !== null &&
|
|
1444
|
+
value !== "" &&
|
|
1445
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
1446
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
1447
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
1448
|
+
if (encoded.length) {
|
|
1449
|
+
return JSON.parse(encoded);
|
|
1450
|
+
}
|
|
1451
|
+
return {};
|
|
1452
|
+
});
|
|
1453
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
1454
|
+
const value = await parseBody(errorBody, context);
|
|
1455
|
+
value.message = value.message ?? value.Message;
|
|
1456
|
+
return value;
|
|
1457
|
+
};
|
|
1458
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
1459
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
1460
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
1461
|
+
let cleanValue = rawValue;
|
|
1698
1462
|
if (typeof cleanValue === "number") {
|
|
1699
1463
|
cleanValue = cleanValue.toString();
|
|
1700
1464
|
}
|
|
@@ -1709,7 +1473,7 @@ var loadRestJsonErrorCode = function (output, data) {
|
|
|
1709
1473
|
}
|
|
1710
1474
|
return cleanValue;
|
|
1711
1475
|
};
|
|
1712
|
-
|
|
1476
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
1713
1477
|
if (headerKey !== undefined) {
|
|
1714
1478
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
1715
1479
|
}
|