@aws-sdk/client-lex-runtime-service 3.183.0 → 3.186.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 -2
- package/dist-es/LexRuntimeService.js +29 -22
- package/dist-es/LexRuntimeServiceClient.js +28 -22
- package/dist-es/commands/DeleteSessionCommand.js +28 -21
- package/dist-es/commands/GetSessionCommand.js +28 -21
- package/dist-es/commands/PostContentCommand.js +28 -21
- package/dist-es/commands/PostTextCommand.js +28 -21
- package/dist-es/commands/PutSessionCommand.js +28 -21
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/LexRuntimeServiceServiceException.js +10 -5
- package/dist-es/models/models_0.js +152 -223
- package/dist-es/protocols/Aws_restJson1.js +913 -753
- package/dist-es/runtimeConfig.browser.js +12 -26
- package/dist-es/runtimeConfig.js +12 -30
- package/dist-es/runtimeConfig.native.js +5 -8
- package/dist-es/runtimeConfig.shared.js +11 -8
- package/package.json +33 -33
|
@@ -1,733 +1,877 @@
|
|
|
1
|
+
import { __assign, __awaiter, __generator, __read } from "tslib";
|
|
1
2
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
2
3
|
import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, LazyJsonString as __LazyJsonString, limitedParseDouble as __limitedParseDouble, map as __map, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
3
4
|
import { LexRuntimeServiceServiceException as __BaseException } from "../models/LexRuntimeServiceServiceException";
|
|
4
5
|
import { BadGatewayException, BadRequestException, ConflictException, DependencyFailedException, InternalFailureException, LimitExceededException, LoopDetectedException, NotAcceptableException, NotFoundException, RequestTimeoutException, UnsupportedMediaTypeException, } from "../models/models_0";
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
6
|
+
export var serializeAws_restJson1DeleteSessionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
8
|
+
return __generator(this, function (_c) {
|
|
9
|
+
switch (_c.label) {
|
|
10
|
+
case 0: return [4, context.endpoint()];
|
|
11
|
+
case 1:
|
|
12
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
13
|
+
headers = {};
|
|
14
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
|
|
15
|
+
"/bot/{botName}/alias/{botAlias}/user/{userId}/session";
|
|
16
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "botName", function () { return input.botName; }, "{botName}", false);
|
|
17
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "botAlias", function () { return input.botAlias; }, "{botAlias}", false);
|
|
18
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "userId", function () { return input.userId; }, "{userId}", false);
|
|
19
|
+
return [2, new __HttpRequest({
|
|
20
|
+
protocol: protocol,
|
|
21
|
+
hostname: hostname,
|
|
22
|
+
port: port,
|
|
23
|
+
method: "DELETE",
|
|
24
|
+
headers: headers,
|
|
25
|
+
path: resolvedPath,
|
|
26
|
+
body: body,
|
|
27
|
+
})];
|
|
28
|
+
}
|
|
22
29
|
});
|
|
23
|
-
};
|
|
24
|
-
export
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
30
|
+
}); };
|
|
31
|
+
export var serializeAws_restJson1GetSessionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
32
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
|
|
33
|
+
return __generator(this, function (_c) {
|
|
34
|
+
switch (_c.label) {
|
|
35
|
+
case 0: return [4, context.endpoint()];
|
|
36
|
+
case 1:
|
|
37
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
38
|
+
headers = {};
|
|
39
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
|
|
40
|
+
"/bot/{botName}/alias/{botAlias}/user/{userId}/session";
|
|
41
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "botName", function () { return input.botName; }, "{botName}", false);
|
|
42
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "botAlias", function () { return input.botAlias; }, "{botAlias}", false);
|
|
43
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "userId", function () { return input.userId; }, "{userId}", false);
|
|
44
|
+
query = map({
|
|
45
|
+
checkpointLabelFilter: [, input.checkpointLabelFilter],
|
|
46
|
+
});
|
|
47
|
+
return [2, new __HttpRequest({
|
|
48
|
+
protocol: protocol,
|
|
49
|
+
hostname: hostname,
|
|
50
|
+
port: port,
|
|
51
|
+
method: "GET",
|
|
52
|
+
headers: headers,
|
|
53
|
+
path: resolvedPath,
|
|
54
|
+
query: query,
|
|
55
|
+
body: body,
|
|
56
|
+
})];
|
|
57
|
+
}
|
|
45
58
|
});
|
|
46
|
-
};
|
|
47
|
-
export
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
59
|
+
}); };
|
|
60
|
+
export var serializeAws_restJson1PostContentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
61
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
62
|
+
return __generator(this, function (_c) {
|
|
63
|
+
switch (_c.label) {
|
|
64
|
+
case 0: return [4, context.endpoint()];
|
|
65
|
+
case 1:
|
|
66
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
67
|
+
headers = map({}, isSerializableHeaderValue, {
|
|
68
|
+
"x-amz-content-sha256": "UNSIGNED-PAYLOAD",
|
|
69
|
+
"content-type": input.contentType || "application/octet-stream",
|
|
70
|
+
"x-amz-lex-session-attributes": [
|
|
71
|
+
function () { return isSerializableHeaderValue(input.sessionAttributes); },
|
|
72
|
+
function () { return context.base64Encoder(Buffer.from(__LazyJsonString.fromObject(input.sessionAttributes))); },
|
|
73
|
+
],
|
|
74
|
+
"x-amz-lex-request-attributes": [
|
|
75
|
+
function () { return isSerializableHeaderValue(input.requestAttributes); },
|
|
76
|
+
function () { return context.base64Encoder(Buffer.from(__LazyJsonString.fromObject(input.requestAttributes))); },
|
|
77
|
+
],
|
|
78
|
+
accept: input.accept,
|
|
79
|
+
"x-amz-lex-active-contexts": [
|
|
80
|
+
function () { return isSerializableHeaderValue(input.activeContexts); },
|
|
81
|
+
function () { return context.base64Encoder(Buffer.from(__LazyJsonString.fromObject(input.activeContexts))); },
|
|
82
|
+
],
|
|
83
|
+
});
|
|
84
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
|
|
85
|
+
"/bot/{botName}/alias/{botAlias}/user/{userId}/content";
|
|
86
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "botName", function () { return input.botName; }, "{botName}", false);
|
|
87
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "botAlias", function () { return input.botAlias; }, "{botAlias}", false);
|
|
88
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "userId", function () { return input.userId; }, "{userId}", false);
|
|
89
|
+
if (input.inputStream !== undefined) {
|
|
90
|
+
body = input.inputStream;
|
|
91
|
+
}
|
|
92
|
+
return [2, new __HttpRequest({
|
|
93
|
+
protocol: protocol,
|
|
94
|
+
hostname: hostname,
|
|
95
|
+
port: port,
|
|
96
|
+
method: "POST",
|
|
97
|
+
headers: headers,
|
|
98
|
+
path: resolvedPath,
|
|
99
|
+
body: body,
|
|
100
|
+
})];
|
|
101
|
+
}
|
|
83
102
|
});
|
|
84
|
-
};
|
|
85
|
-
export
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
103
|
+
}); };
|
|
104
|
+
export var serializeAws_restJson1PostTextCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
105
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
106
|
+
return __generator(this, function (_c) {
|
|
107
|
+
switch (_c.label) {
|
|
108
|
+
case 0: return [4, context.endpoint()];
|
|
109
|
+
case 1:
|
|
110
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
111
|
+
headers = {
|
|
112
|
+
"content-type": "application/json",
|
|
113
|
+
};
|
|
114
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
|
|
115
|
+
"/bot/{botName}/alias/{botAlias}/user/{userId}/text";
|
|
116
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "botName", function () { return input.botName; }, "{botName}", false);
|
|
117
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "botAlias", function () { return input.botAlias; }, "{botAlias}", false);
|
|
118
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "userId", function () { return input.userId; }, "{userId}", false);
|
|
119
|
+
body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.activeContexts != null && {
|
|
120
|
+
activeContexts: serializeAws_restJson1ActiveContextsList(input.activeContexts, context),
|
|
121
|
+
})), (input.inputText != null && { inputText: input.inputText })), (input.requestAttributes != null && {
|
|
122
|
+
requestAttributes: serializeAws_restJson1StringMap(input.requestAttributes, context),
|
|
123
|
+
})), (input.sessionAttributes != null && {
|
|
124
|
+
sessionAttributes: serializeAws_restJson1StringMap(input.sessionAttributes, context),
|
|
125
|
+
})));
|
|
126
|
+
return [2, new __HttpRequest({
|
|
127
|
+
protocol: protocol,
|
|
128
|
+
hostname: hostname,
|
|
129
|
+
port: port,
|
|
130
|
+
method: "POST",
|
|
131
|
+
headers: headers,
|
|
132
|
+
path: resolvedPath,
|
|
133
|
+
body: body,
|
|
134
|
+
})];
|
|
135
|
+
}
|
|
116
136
|
});
|
|
117
|
-
};
|
|
118
|
-
export
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
137
|
+
}); };
|
|
138
|
+
export var serializeAws_restJson1PutSessionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
139
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
140
|
+
return __generator(this, function (_c) {
|
|
141
|
+
switch (_c.label) {
|
|
142
|
+
case 0: return [4, context.endpoint()];
|
|
143
|
+
case 1:
|
|
144
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
145
|
+
headers = map({}, isSerializableHeaderValue, {
|
|
146
|
+
"content-type": "application/json",
|
|
147
|
+
accept: input.accept,
|
|
148
|
+
});
|
|
149
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
|
|
150
|
+
"/bot/{botName}/alias/{botAlias}/user/{userId}/session";
|
|
151
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "botName", function () { return input.botName; }, "{botName}", false);
|
|
152
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "botAlias", function () { return input.botAlias; }, "{botAlias}", false);
|
|
153
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "userId", function () { return input.userId; }, "{userId}", false);
|
|
154
|
+
body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.activeContexts != null && {
|
|
155
|
+
activeContexts: serializeAws_restJson1ActiveContextsList(input.activeContexts, context),
|
|
156
|
+
})), (input.dialogAction != null && {
|
|
157
|
+
dialogAction: serializeAws_restJson1DialogAction(input.dialogAction, context),
|
|
158
|
+
})), (input.recentIntentSummaryView != null && {
|
|
159
|
+
recentIntentSummaryView: serializeAws_restJson1IntentSummaryList(input.recentIntentSummaryView, context),
|
|
160
|
+
})), (input.sessionAttributes != null && {
|
|
161
|
+
sessionAttributes: serializeAws_restJson1StringMap(input.sessionAttributes, context),
|
|
162
|
+
})));
|
|
163
|
+
return [2, new __HttpRequest({
|
|
164
|
+
protocol: protocol,
|
|
165
|
+
hostname: hostname,
|
|
166
|
+
port: port,
|
|
167
|
+
method: "POST",
|
|
168
|
+
headers: headers,
|
|
169
|
+
path: resolvedPath,
|
|
170
|
+
body: body,
|
|
171
|
+
})];
|
|
172
|
+
}
|
|
152
173
|
});
|
|
153
|
-
};
|
|
154
|
-
export
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
174
|
+
}); };
|
|
175
|
+
export var deserializeAws_restJson1DeleteSessionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
176
|
+
var contents, data, _a, _b;
|
|
177
|
+
return __generator(this, function (_c) {
|
|
178
|
+
switch (_c.label) {
|
|
179
|
+
case 0:
|
|
180
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
181
|
+
return [2, deserializeAws_restJson1DeleteSessionCommandError(output, context)];
|
|
182
|
+
}
|
|
183
|
+
contents = map({
|
|
184
|
+
$metadata: deserializeMetadata(output),
|
|
185
|
+
});
|
|
186
|
+
_a = __expectNonNull;
|
|
187
|
+
_b = __expectObject;
|
|
188
|
+
return [4, parseBody(output.body, context)];
|
|
189
|
+
case 1:
|
|
190
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
191
|
+
if (data.botAlias != null) {
|
|
192
|
+
contents.botAlias = __expectString(data.botAlias);
|
|
193
|
+
}
|
|
194
|
+
if (data.botName != null) {
|
|
195
|
+
contents.botName = __expectString(data.botName);
|
|
196
|
+
}
|
|
197
|
+
if (data.sessionId != null) {
|
|
198
|
+
contents.sessionId = __expectString(data.sessionId);
|
|
199
|
+
}
|
|
200
|
+
if (data.userId != null) {
|
|
201
|
+
contents.userId = __expectString(data.userId);
|
|
202
|
+
}
|
|
203
|
+
return [2, contents];
|
|
204
|
+
}
|
|
160
205
|
});
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
throw
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
throw
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
210
|
-
return deserializeAws_restJson1GetSessionCommandError(output, context);
|
|
211
|
-
}
|
|
212
|
-
const contents = map({
|
|
213
|
-
$metadata: deserializeMetadata(output),
|
|
206
|
+
}); };
|
|
207
|
+
var deserializeAws_restJson1DeleteSessionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
208
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
209
|
+
var _c;
|
|
210
|
+
return __generator(this, function (_d) {
|
|
211
|
+
switch (_d.label) {
|
|
212
|
+
case 0:
|
|
213
|
+
_a = [__assign({}, output)];
|
|
214
|
+
_c = {};
|
|
215
|
+
return [4, parseErrorBody(output.body, context)];
|
|
216
|
+
case 1:
|
|
217
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
218
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
219
|
+
_b = errorCode;
|
|
220
|
+
switch (_b) {
|
|
221
|
+
case "BadRequestException": return [3, 2];
|
|
222
|
+
case "com.amazonaws.lexruntimeservice#BadRequestException": return [3, 2];
|
|
223
|
+
case "ConflictException": return [3, 4];
|
|
224
|
+
case "com.amazonaws.lexruntimeservice#ConflictException": return [3, 4];
|
|
225
|
+
case "InternalFailureException": return [3, 6];
|
|
226
|
+
case "com.amazonaws.lexruntimeservice#InternalFailureException": return [3, 6];
|
|
227
|
+
case "LimitExceededException": return [3, 8];
|
|
228
|
+
case "com.amazonaws.lexruntimeservice#LimitExceededException": return [3, 8];
|
|
229
|
+
case "NotFoundException": return [3, 10];
|
|
230
|
+
case "com.amazonaws.lexruntimeservice#NotFoundException": return [3, 10];
|
|
231
|
+
}
|
|
232
|
+
return [3, 12];
|
|
233
|
+
case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
|
|
234
|
+
case 3: throw _d.sent();
|
|
235
|
+
case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
|
|
236
|
+
case 5: throw _d.sent();
|
|
237
|
+
case 6: return [4, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
|
|
238
|
+
case 7: throw _d.sent();
|
|
239
|
+
case 8: return [4, deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)];
|
|
240
|
+
case 9: throw _d.sent();
|
|
241
|
+
case 10: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
|
|
242
|
+
case 11: throw _d.sent();
|
|
243
|
+
case 12:
|
|
244
|
+
parsedBody = parsedOutput.body;
|
|
245
|
+
throwDefaultError({
|
|
246
|
+
output: output,
|
|
247
|
+
parsedBody: parsedBody,
|
|
248
|
+
exceptionCtor: __BaseException,
|
|
249
|
+
errorCode: errorCode,
|
|
250
|
+
});
|
|
251
|
+
_d.label = 13;
|
|
252
|
+
case 13: return [2];
|
|
253
|
+
}
|
|
214
254
|
});
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
case "NotFoundException":
|
|
250
|
-
case "com.amazonaws.lexruntimeservice#NotFoundException":
|
|
251
|
-
throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
|
|
252
|
-
default:
|
|
253
|
-
const parsedBody = parsedOutput.body;
|
|
254
|
-
throwDefaultError({
|
|
255
|
-
output,
|
|
256
|
-
parsedBody,
|
|
257
|
-
exceptionCtor: __BaseException,
|
|
258
|
-
errorCode,
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
};
|
|
262
|
-
export const deserializeAws_restJson1PostContentCommand = async (output, context) => {
|
|
263
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
264
|
-
return deserializeAws_restJson1PostContentCommandError(output, context);
|
|
265
|
-
}
|
|
266
|
-
const contents = map({
|
|
267
|
-
$metadata: deserializeMetadata(output),
|
|
268
|
-
contentType: [, output.headers["content-type"]],
|
|
269
|
-
intentName: [, output.headers["x-amz-lex-intent-name"]],
|
|
270
|
-
nluIntentConfidence: [
|
|
271
|
-
() => void 0 !== output.headers["x-amz-lex-nlu-intent-confidence"],
|
|
272
|
-
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-nlu-intent-confidence"])).toString("utf8")),
|
|
273
|
-
],
|
|
274
|
-
alternativeIntents: [
|
|
275
|
-
() => void 0 !== output.headers["x-amz-lex-alternative-intents"],
|
|
276
|
-
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-alternative-intents"])).toString("utf8")),
|
|
277
|
-
],
|
|
278
|
-
slots: [
|
|
279
|
-
() => void 0 !== output.headers["x-amz-lex-slots"],
|
|
280
|
-
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-slots"])).toString("utf8")),
|
|
281
|
-
],
|
|
282
|
-
sessionAttributes: [
|
|
283
|
-
() => void 0 !== output.headers["x-amz-lex-session-attributes"],
|
|
284
|
-
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-session-attributes"])).toString("utf8")),
|
|
285
|
-
],
|
|
286
|
-
sentimentResponse: [, output.headers["x-amz-lex-sentiment"]],
|
|
287
|
-
message: [, output.headers["x-amz-lex-message"]],
|
|
288
|
-
encodedMessage: [, output.headers["x-amz-lex-encoded-message"]],
|
|
289
|
-
messageFormat: [, output.headers["x-amz-lex-message-format"]],
|
|
290
|
-
dialogState: [, output.headers["x-amz-lex-dialog-state"]],
|
|
291
|
-
slotToElicit: [, output.headers["x-amz-lex-slot-to-elicit"]],
|
|
292
|
-
inputTranscript: [, output.headers["x-amz-lex-input-transcript"]],
|
|
293
|
-
encodedInputTranscript: [, output.headers["x-amz-lex-encoded-input-transcript"]],
|
|
294
|
-
botVersion: [, output.headers["x-amz-lex-bot-version"]],
|
|
295
|
-
sessionId: [, output.headers["x-amz-lex-session-id"]],
|
|
296
|
-
activeContexts: [
|
|
297
|
-
() => void 0 !== output.headers["x-amz-lex-active-contexts"],
|
|
298
|
-
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-active-contexts"])).toString("utf8")),
|
|
299
|
-
],
|
|
300
|
-
});
|
|
301
|
-
const data = output.body;
|
|
302
|
-
contents.audioStream = data;
|
|
303
|
-
return contents;
|
|
304
|
-
};
|
|
305
|
-
const deserializeAws_restJson1PostContentCommandError = async (output, context) => {
|
|
306
|
-
const parsedOutput = {
|
|
307
|
-
...output,
|
|
308
|
-
body: await parseErrorBody(output.body, context),
|
|
309
|
-
};
|
|
310
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
311
|
-
switch (errorCode) {
|
|
312
|
-
case "BadGatewayException":
|
|
313
|
-
case "com.amazonaws.lexruntimeservice#BadGatewayException":
|
|
314
|
-
throw await deserializeAws_restJson1BadGatewayExceptionResponse(parsedOutput, context);
|
|
315
|
-
case "BadRequestException":
|
|
316
|
-
case "com.amazonaws.lexruntimeservice#BadRequestException":
|
|
317
|
-
throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
|
|
318
|
-
case "ConflictException":
|
|
319
|
-
case "com.amazonaws.lexruntimeservice#ConflictException":
|
|
320
|
-
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
321
|
-
case "DependencyFailedException":
|
|
322
|
-
case "com.amazonaws.lexruntimeservice#DependencyFailedException":
|
|
323
|
-
throw await deserializeAws_restJson1DependencyFailedExceptionResponse(parsedOutput, context);
|
|
324
|
-
case "InternalFailureException":
|
|
325
|
-
case "com.amazonaws.lexruntimeservice#InternalFailureException":
|
|
326
|
-
throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
|
|
327
|
-
case "LimitExceededException":
|
|
328
|
-
case "com.amazonaws.lexruntimeservice#LimitExceededException":
|
|
329
|
-
throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
|
|
330
|
-
case "LoopDetectedException":
|
|
331
|
-
case "com.amazonaws.lexruntimeservice#LoopDetectedException":
|
|
332
|
-
throw await deserializeAws_restJson1LoopDetectedExceptionResponse(parsedOutput, context);
|
|
333
|
-
case "NotAcceptableException":
|
|
334
|
-
case "com.amazonaws.lexruntimeservice#NotAcceptableException":
|
|
335
|
-
throw await deserializeAws_restJson1NotAcceptableExceptionResponse(parsedOutput, context);
|
|
336
|
-
case "NotFoundException":
|
|
337
|
-
case "com.amazonaws.lexruntimeservice#NotFoundException":
|
|
338
|
-
throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
|
|
339
|
-
case "RequestTimeoutException":
|
|
340
|
-
case "com.amazonaws.lexruntimeservice#RequestTimeoutException":
|
|
341
|
-
throw await deserializeAws_restJson1RequestTimeoutExceptionResponse(parsedOutput, context);
|
|
342
|
-
case "UnsupportedMediaTypeException":
|
|
343
|
-
case "com.amazonaws.lexruntimeservice#UnsupportedMediaTypeException":
|
|
344
|
-
throw await deserializeAws_restJson1UnsupportedMediaTypeExceptionResponse(parsedOutput, context);
|
|
345
|
-
default:
|
|
346
|
-
const parsedBody = parsedOutput.body;
|
|
347
|
-
throwDefaultError({
|
|
348
|
-
output,
|
|
349
|
-
parsedBody,
|
|
350
|
-
exceptionCtor: __BaseException,
|
|
351
|
-
errorCode,
|
|
352
|
-
});
|
|
353
|
-
}
|
|
354
|
-
};
|
|
355
|
-
export const deserializeAws_restJson1PostTextCommand = async (output, context) => {
|
|
356
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
357
|
-
return deserializeAws_restJson1PostTextCommandError(output, context);
|
|
358
|
-
}
|
|
359
|
-
const contents = map({
|
|
360
|
-
$metadata: deserializeMetadata(output),
|
|
255
|
+
}); };
|
|
256
|
+
export var deserializeAws_restJson1GetSessionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
257
|
+
var contents, data, _a, _b;
|
|
258
|
+
return __generator(this, function (_c) {
|
|
259
|
+
switch (_c.label) {
|
|
260
|
+
case 0:
|
|
261
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
262
|
+
return [2, deserializeAws_restJson1GetSessionCommandError(output, context)];
|
|
263
|
+
}
|
|
264
|
+
contents = map({
|
|
265
|
+
$metadata: deserializeMetadata(output),
|
|
266
|
+
});
|
|
267
|
+
_a = __expectNonNull;
|
|
268
|
+
_b = __expectObject;
|
|
269
|
+
return [4, parseBody(output.body, context)];
|
|
270
|
+
case 1:
|
|
271
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
272
|
+
if (data.activeContexts != null) {
|
|
273
|
+
contents.activeContexts = deserializeAws_restJson1ActiveContextsList(data.activeContexts, context);
|
|
274
|
+
}
|
|
275
|
+
if (data.dialogAction != null) {
|
|
276
|
+
contents.dialogAction = deserializeAws_restJson1DialogAction(data.dialogAction, context);
|
|
277
|
+
}
|
|
278
|
+
if (data.recentIntentSummaryView != null) {
|
|
279
|
+
contents.recentIntentSummaryView = deserializeAws_restJson1IntentSummaryList(data.recentIntentSummaryView, context);
|
|
280
|
+
}
|
|
281
|
+
if (data.sessionAttributes != null) {
|
|
282
|
+
contents.sessionAttributes = deserializeAws_restJson1StringMap(data.sessionAttributes, context);
|
|
283
|
+
}
|
|
284
|
+
if (data.sessionId != null) {
|
|
285
|
+
contents.sessionId = __expectString(data.sessionId);
|
|
286
|
+
}
|
|
287
|
+
return [2, contents];
|
|
288
|
+
}
|
|
361
289
|
});
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
};
|
|
407
|
-
const deserializeAws_restJson1PostTextCommandError = async (output, context) => {
|
|
408
|
-
const parsedOutput = {
|
|
409
|
-
...output,
|
|
410
|
-
body: await parseErrorBody(output.body, context),
|
|
411
|
-
};
|
|
412
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
413
|
-
switch (errorCode) {
|
|
414
|
-
case "BadGatewayException":
|
|
415
|
-
case "com.amazonaws.lexruntimeservice#BadGatewayException":
|
|
416
|
-
throw await deserializeAws_restJson1BadGatewayExceptionResponse(parsedOutput, context);
|
|
417
|
-
case "BadRequestException":
|
|
418
|
-
case "com.amazonaws.lexruntimeservice#BadRequestException":
|
|
419
|
-
throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
|
|
420
|
-
case "ConflictException":
|
|
421
|
-
case "com.amazonaws.lexruntimeservice#ConflictException":
|
|
422
|
-
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
423
|
-
case "DependencyFailedException":
|
|
424
|
-
case "com.amazonaws.lexruntimeservice#DependencyFailedException":
|
|
425
|
-
throw await deserializeAws_restJson1DependencyFailedExceptionResponse(parsedOutput, context);
|
|
426
|
-
case "InternalFailureException":
|
|
427
|
-
case "com.amazonaws.lexruntimeservice#InternalFailureException":
|
|
428
|
-
throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
|
|
429
|
-
case "LimitExceededException":
|
|
430
|
-
case "com.amazonaws.lexruntimeservice#LimitExceededException":
|
|
431
|
-
throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
|
|
432
|
-
case "LoopDetectedException":
|
|
433
|
-
case "com.amazonaws.lexruntimeservice#LoopDetectedException":
|
|
434
|
-
throw await deserializeAws_restJson1LoopDetectedExceptionResponse(parsedOutput, context);
|
|
435
|
-
case "NotFoundException":
|
|
436
|
-
case "com.amazonaws.lexruntimeservice#NotFoundException":
|
|
437
|
-
throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
|
|
438
|
-
default:
|
|
439
|
-
const parsedBody = parsedOutput.body;
|
|
440
|
-
throwDefaultError({
|
|
441
|
-
output,
|
|
442
|
-
parsedBody,
|
|
443
|
-
exceptionCtor: __BaseException,
|
|
444
|
-
errorCode,
|
|
445
|
-
});
|
|
446
|
-
}
|
|
447
|
-
};
|
|
448
|
-
export const deserializeAws_restJson1PutSessionCommand = async (output, context) => {
|
|
449
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
450
|
-
return deserializeAws_restJson1PutSessionCommandError(output, context);
|
|
451
|
-
}
|
|
452
|
-
const contents = map({
|
|
453
|
-
$metadata: deserializeMetadata(output),
|
|
454
|
-
contentType: [, output.headers["content-type"]],
|
|
455
|
-
intentName: [, output.headers["x-amz-lex-intent-name"]],
|
|
456
|
-
slots: [
|
|
457
|
-
() => void 0 !== output.headers["x-amz-lex-slots"],
|
|
458
|
-
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-slots"])).toString("utf8")),
|
|
459
|
-
],
|
|
460
|
-
sessionAttributes: [
|
|
461
|
-
() => void 0 !== output.headers["x-amz-lex-session-attributes"],
|
|
462
|
-
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-session-attributes"])).toString("utf8")),
|
|
463
|
-
],
|
|
464
|
-
message: [, output.headers["x-amz-lex-message"]],
|
|
465
|
-
encodedMessage: [, output.headers["x-amz-lex-encoded-message"]],
|
|
466
|
-
messageFormat: [, output.headers["x-amz-lex-message-format"]],
|
|
467
|
-
dialogState: [, output.headers["x-amz-lex-dialog-state"]],
|
|
468
|
-
slotToElicit: [, output.headers["x-amz-lex-slot-to-elicit"]],
|
|
469
|
-
sessionId: [, output.headers["x-amz-lex-session-id"]],
|
|
470
|
-
activeContexts: [
|
|
471
|
-
() => void 0 !== output.headers["x-amz-lex-active-contexts"],
|
|
472
|
-
() => new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-active-contexts"])).toString("utf8")),
|
|
473
|
-
],
|
|
474
|
-
});
|
|
475
|
-
const data = output.body;
|
|
476
|
-
contents.audioStream = data;
|
|
477
|
-
return contents;
|
|
478
|
-
};
|
|
479
|
-
const deserializeAws_restJson1PutSessionCommandError = async (output, context) => {
|
|
480
|
-
const parsedOutput = {
|
|
481
|
-
...output,
|
|
482
|
-
body: await parseErrorBody(output.body, context),
|
|
483
|
-
};
|
|
484
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
485
|
-
switch (errorCode) {
|
|
486
|
-
case "BadGatewayException":
|
|
487
|
-
case "com.amazonaws.lexruntimeservice#BadGatewayException":
|
|
488
|
-
throw await deserializeAws_restJson1BadGatewayExceptionResponse(parsedOutput, context);
|
|
489
|
-
case "BadRequestException":
|
|
490
|
-
case "com.amazonaws.lexruntimeservice#BadRequestException":
|
|
491
|
-
throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
|
|
492
|
-
case "ConflictException":
|
|
493
|
-
case "com.amazonaws.lexruntimeservice#ConflictException":
|
|
494
|
-
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
495
|
-
case "DependencyFailedException":
|
|
496
|
-
case "com.amazonaws.lexruntimeservice#DependencyFailedException":
|
|
497
|
-
throw await deserializeAws_restJson1DependencyFailedExceptionResponse(parsedOutput, context);
|
|
498
|
-
case "InternalFailureException":
|
|
499
|
-
case "com.amazonaws.lexruntimeservice#InternalFailureException":
|
|
500
|
-
throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
|
|
501
|
-
case "LimitExceededException":
|
|
502
|
-
case "com.amazonaws.lexruntimeservice#LimitExceededException":
|
|
503
|
-
throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
|
|
504
|
-
case "NotAcceptableException":
|
|
505
|
-
case "com.amazonaws.lexruntimeservice#NotAcceptableException":
|
|
506
|
-
throw await deserializeAws_restJson1NotAcceptableExceptionResponse(parsedOutput, context);
|
|
507
|
-
case "NotFoundException":
|
|
508
|
-
case "com.amazonaws.lexruntimeservice#NotFoundException":
|
|
509
|
-
throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
|
|
510
|
-
default:
|
|
511
|
-
const parsedBody = parsedOutput.body;
|
|
512
|
-
throwDefaultError({
|
|
513
|
-
output,
|
|
514
|
-
parsedBody,
|
|
515
|
-
exceptionCtor: __BaseException,
|
|
516
|
-
errorCode,
|
|
517
|
-
});
|
|
518
|
-
}
|
|
519
|
-
};
|
|
520
|
-
const map = __map;
|
|
521
|
-
const deserializeAws_restJson1BadGatewayExceptionResponse = async (parsedOutput, context) => {
|
|
522
|
-
const contents = map({});
|
|
523
|
-
const data = parsedOutput.body;
|
|
524
|
-
if (data.Message != null) {
|
|
525
|
-
contents.Message = __expectString(data.Message);
|
|
526
|
-
}
|
|
527
|
-
const exception = new BadGatewayException({
|
|
528
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
529
|
-
...contents,
|
|
290
|
+
}); };
|
|
291
|
+
var deserializeAws_restJson1GetSessionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
292
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
293
|
+
var _c;
|
|
294
|
+
return __generator(this, function (_d) {
|
|
295
|
+
switch (_d.label) {
|
|
296
|
+
case 0:
|
|
297
|
+
_a = [__assign({}, output)];
|
|
298
|
+
_c = {};
|
|
299
|
+
return [4, parseErrorBody(output.body, context)];
|
|
300
|
+
case 1:
|
|
301
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
302
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
303
|
+
_b = errorCode;
|
|
304
|
+
switch (_b) {
|
|
305
|
+
case "BadRequestException": return [3, 2];
|
|
306
|
+
case "com.amazonaws.lexruntimeservice#BadRequestException": return [3, 2];
|
|
307
|
+
case "InternalFailureException": return [3, 4];
|
|
308
|
+
case "com.amazonaws.lexruntimeservice#InternalFailureException": return [3, 4];
|
|
309
|
+
case "LimitExceededException": return [3, 6];
|
|
310
|
+
case "com.amazonaws.lexruntimeservice#LimitExceededException": return [3, 6];
|
|
311
|
+
case "NotFoundException": return [3, 8];
|
|
312
|
+
case "com.amazonaws.lexruntimeservice#NotFoundException": return [3, 8];
|
|
313
|
+
}
|
|
314
|
+
return [3, 10];
|
|
315
|
+
case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
|
|
316
|
+
case 3: throw _d.sent();
|
|
317
|
+
case 4: return [4, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
|
|
318
|
+
case 5: throw _d.sent();
|
|
319
|
+
case 6: return [4, deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)];
|
|
320
|
+
case 7: throw _d.sent();
|
|
321
|
+
case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
|
|
322
|
+
case 9: throw _d.sent();
|
|
323
|
+
case 10:
|
|
324
|
+
parsedBody = parsedOutput.body;
|
|
325
|
+
throwDefaultError({
|
|
326
|
+
output: output,
|
|
327
|
+
parsedBody: parsedBody,
|
|
328
|
+
exceptionCtor: __BaseException,
|
|
329
|
+
errorCode: errorCode,
|
|
330
|
+
});
|
|
331
|
+
_d.label = 11;
|
|
332
|
+
case 11: return [2];
|
|
333
|
+
}
|
|
530
334
|
});
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
335
|
+
}); };
|
|
336
|
+
export var deserializeAws_restJson1PostContentCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
337
|
+
var contents, data;
|
|
338
|
+
return __generator(this, function (_a) {
|
|
339
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
340
|
+
return [2, deserializeAws_restJson1PostContentCommandError(output, context)];
|
|
341
|
+
}
|
|
342
|
+
contents = map({
|
|
343
|
+
$metadata: deserializeMetadata(output),
|
|
344
|
+
contentType: [, output.headers["content-type"]],
|
|
345
|
+
intentName: [, output.headers["x-amz-lex-intent-name"]],
|
|
346
|
+
nluIntentConfidence: [
|
|
347
|
+
function () { return void 0 !== output.headers["x-amz-lex-nlu-intent-confidence"]; },
|
|
348
|
+
function () {
|
|
349
|
+
return new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-nlu-intent-confidence"])).toString("utf8"));
|
|
350
|
+
},
|
|
351
|
+
],
|
|
352
|
+
alternativeIntents: [
|
|
353
|
+
function () { return void 0 !== output.headers["x-amz-lex-alternative-intents"]; },
|
|
354
|
+
function () {
|
|
355
|
+
return new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-alternative-intents"])).toString("utf8"));
|
|
356
|
+
},
|
|
357
|
+
],
|
|
358
|
+
slots: [
|
|
359
|
+
function () { return void 0 !== output.headers["x-amz-lex-slots"]; },
|
|
360
|
+
function () {
|
|
361
|
+
return new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-slots"])).toString("utf8"));
|
|
362
|
+
},
|
|
363
|
+
],
|
|
364
|
+
sessionAttributes: [
|
|
365
|
+
function () { return void 0 !== output.headers["x-amz-lex-session-attributes"]; },
|
|
366
|
+
function () {
|
|
367
|
+
return new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-session-attributes"])).toString("utf8"));
|
|
368
|
+
},
|
|
369
|
+
],
|
|
370
|
+
sentimentResponse: [, output.headers["x-amz-lex-sentiment"]],
|
|
371
|
+
message: [, output.headers["x-amz-lex-message"]],
|
|
372
|
+
encodedMessage: [, output.headers["x-amz-lex-encoded-message"]],
|
|
373
|
+
messageFormat: [, output.headers["x-amz-lex-message-format"]],
|
|
374
|
+
dialogState: [, output.headers["x-amz-lex-dialog-state"]],
|
|
375
|
+
slotToElicit: [, output.headers["x-amz-lex-slot-to-elicit"]],
|
|
376
|
+
inputTranscript: [, output.headers["x-amz-lex-input-transcript"]],
|
|
377
|
+
encodedInputTranscript: [, output.headers["x-amz-lex-encoded-input-transcript"]],
|
|
378
|
+
botVersion: [, output.headers["x-amz-lex-bot-version"]],
|
|
379
|
+
sessionId: [, output.headers["x-amz-lex-session-id"]],
|
|
380
|
+
activeContexts: [
|
|
381
|
+
function () { return void 0 !== output.headers["x-amz-lex-active-contexts"]; },
|
|
382
|
+
function () {
|
|
383
|
+
return new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-active-contexts"])).toString("utf8"));
|
|
384
|
+
},
|
|
385
|
+
],
|
|
386
|
+
});
|
|
387
|
+
data = output.body;
|
|
388
|
+
contents.audioStream = data;
|
|
389
|
+
return [2, contents];
|
|
542
390
|
});
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
391
|
+
}); };
|
|
392
|
+
var deserializeAws_restJson1PostContentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
393
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
394
|
+
var _c;
|
|
395
|
+
return __generator(this, function (_d) {
|
|
396
|
+
switch (_d.label) {
|
|
397
|
+
case 0:
|
|
398
|
+
_a = [__assign({}, output)];
|
|
399
|
+
_c = {};
|
|
400
|
+
return [4, parseErrorBody(output.body, context)];
|
|
401
|
+
case 1:
|
|
402
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
403
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
404
|
+
_b = errorCode;
|
|
405
|
+
switch (_b) {
|
|
406
|
+
case "BadGatewayException": return [3, 2];
|
|
407
|
+
case "com.amazonaws.lexruntimeservice#BadGatewayException": return [3, 2];
|
|
408
|
+
case "BadRequestException": return [3, 4];
|
|
409
|
+
case "com.amazonaws.lexruntimeservice#BadRequestException": return [3, 4];
|
|
410
|
+
case "ConflictException": return [3, 6];
|
|
411
|
+
case "com.amazonaws.lexruntimeservice#ConflictException": return [3, 6];
|
|
412
|
+
case "DependencyFailedException": return [3, 8];
|
|
413
|
+
case "com.amazonaws.lexruntimeservice#DependencyFailedException": return [3, 8];
|
|
414
|
+
case "InternalFailureException": return [3, 10];
|
|
415
|
+
case "com.amazonaws.lexruntimeservice#InternalFailureException": return [3, 10];
|
|
416
|
+
case "LimitExceededException": return [3, 12];
|
|
417
|
+
case "com.amazonaws.lexruntimeservice#LimitExceededException": return [3, 12];
|
|
418
|
+
case "LoopDetectedException": return [3, 14];
|
|
419
|
+
case "com.amazonaws.lexruntimeservice#LoopDetectedException": return [3, 14];
|
|
420
|
+
case "NotAcceptableException": return [3, 16];
|
|
421
|
+
case "com.amazonaws.lexruntimeservice#NotAcceptableException": return [3, 16];
|
|
422
|
+
case "NotFoundException": return [3, 18];
|
|
423
|
+
case "com.amazonaws.lexruntimeservice#NotFoundException": return [3, 18];
|
|
424
|
+
case "RequestTimeoutException": return [3, 20];
|
|
425
|
+
case "com.amazonaws.lexruntimeservice#RequestTimeoutException": return [3, 20];
|
|
426
|
+
case "UnsupportedMediaTypeException": return [3, 22];
|
|
427
|
+
case "com.amazonaws.lexruntimeservice#UnsupportedMediaTypeException": return [3, 22];
|
|
428
|
+
}
|
|
429
|
+
return [3, 24];
|
|
430
|
+
case 2: return [4, deserializeAws_restJson1BadGatewayExceptionResponse(parsedOutput, context)];
|
|
431
|
+
case 3: throw _d.sent();
|
|
432
|
+
case 4: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
|
|
433
|
+
case 5: throw _d.sent();
|
|
434
|
+
case 6: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
|
|
435
|
+
case 7: throw _d.sent();
|
|
436
|
+
case 8: return [4, deserializeAws_restJson1DependencyFailedExceptionResponse(parsedOutput, context)];
|
|
437
|
+
case 9: throw _d.sent();
|
|
438
|
+
case 10: return [4, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
|
|
439
|
+
case 11: throw _d.sent();
|
|
440
|
+
case 12: return [4, deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)];
|
|
441
|
+
case 13: throw _d.sent();
|
|
442
|
+
case 14: return [4, deserializeAws_restJson1LoopDetectedExceptionResponse(parsedOutput, context)];
|
|
443
|
+
case 15: throw _d.sent();
|
|
444
|
+
case 16: return [4, deserializeAws_restJson1NotAcceptableExceptionResponse(parsedOutput, context)];
|
|
445
|
+
case 17: throw _d.sent();
|
|
446
|
+
case 18: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
|
|
447
|
+
case 19: throw _d.sent();
|
|
448
|
+
case 20: return [4, deserializeAws_restJson1RequestTimeoutExceptionResponse(parsedOutput, context)];
|
|
449
|
+
case 21: throw _d.sent();
|
|
450
|
+
case 22: return [4, deserializeAws_restJson1UnsupportedMediaTypeExceptionResponse(parsedOutput, context)];
|
|
451
|
+
case 23: throw _d.sent();
|
|
452
|
+
case 24:
|
|
453
|
+
parsedBody = parsedOutput.body;
|
|
454
|
+
throwDefaultError({
|
|
455
|
+
output: output,
|
|
456
|
+
parsedBody: parsedBody,
|
|
457
|
+
exceptionCtor: __BaseException,
|
|
458
|
+
errorCode: errorCode,
|
|
459
|
+
});
|
|
460
|
+
_d.label = 25;
|
|
461
|
+
case 25: return [2];
|
|
462
|
+
}
|
|
554
463
|
});
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
464
|
+
}); };
|
|
465
|
+
export var deserializeAws_restJson1PostTextCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
466
|
+
var contents, data, _a, _b;
|
|
467
|
+
return __generator(this, function (_c) {
|
|
468
|
+
switch (_c.label) {
|
|
469
|
+
case 0:
|
|
470
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
471
|
+
return [2, deserializeAws_restJson1PostTextCommandError(output, context)];
|
|
472
|
+
}
|
|
473
|
+
contents = map({
|
|
474
|
+
$metadata: deserializeMetadata(output),
|
|
475
|
+
});
|
|
476
|
+
_a = __expectNonNull;
|
|
477
|
+
_b = __expectObject;
|
|
478
|
+
return [4, parseBody(output.body, context)];
|
|
479
|
+
case 1:
|
|
480
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
481
|
+
if (data.activeContexts != null) {
|
|
482
|
+
contents.activeContexts = deserializeAws_restJson1ActiveContextsList(data.activeContexts, context);
|
|
483
|
+
}
|
|
484
|
+
if (data.alternativeIntents != null) {
|
|
485
|
+
contents.alternativeIntents = deserializeAws_restJson1IntentList(data.alternativeIntents, context);
|
|
486
|
+
}
|
|
487
|
+
if (data.botVersion != null) {
|
|
488
|
+
contents.botVersion = __expectString(data.botVersion);
|
|
489
|
+
}
|
|
490
|
+
if (data.dialogState != null) {
|
|
491
|
+
contents.dialogState = __expectString(data.dialogState);
|
|
492
|
+
}
|
|
493
|
+
if (data.intentName != null) {
|
|
494
|
+
contents.intentName = __expectString(data.intentName);
|
|
495
|
+
}
|
|
496
|
+
if (data.message != null) {
|
|
497
|
+
contents.message = __expectString(data.message);
|
|
498
|
+
}
|
|
499
|
+
if (data.messageFormat != null) {
|
|
500
|
+
contents.messageFormat = __expectString(data.messageFormat);
|
|
501
|
+
}
|
|
502
|
+
if (data.nluIntentConfidence != null) {
|
|
503
|
+
contents.nluIntentConfidence = deserializeAws_restJson1IntentConfidence(data.nluIntentConfidence, context);
|
|
504
|
+
}
|
|
505
|
+
if (data.responseCard != null) {
|
|
506
|
+
contents.responseCard = deserializeAws_restJson1ResponseCard(data.responseCard, context);
|
|
507
|
+
}
|
|
508
|
+
if (data.sentimentResponse != null) {
|
|
509
|
+
contents.sentimentResponse = deserializeAws_restJson1SentimentResponse(data.sentimentResponse, context);
|
|
510
|
+
}
|
|
511
|
+
if (data.sessionAttributes != null) {
|
|
512
|
+
contents.sessionAttributes = deserializeAws_restJson1StringMap(data.sessionAttributes, context);
|
|
513
|
+
}
|
|
514
|
+
if (data.sessionId != null) {
|
|
515
|
+
contents.sessionId = __expectString(data.sessionId);
|
|
516
|
+
}
|
|
517
|
+
if (data.slotToElicit != null) {
|
|
518
|
+
contents.slotToElicit = __expectString(data.slotToElicit);
|
|
519
|
+
}
|
|
520
|
+
if (data.slots != null) {
|
|
521
|
+
contents.slots = deserializeAws_restJson1StringMap(data.slots, context);
|
|
522
|
+
}
|
|
523
|
+
return [2, contents];
|
|
524
|
+
}
|
|
566
525
|
});
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
526
|
+
}); };
|
|
527
|
+
var deserializeAws_restJson1PostTextCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
528
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
529
|
+
var _c;
|
|
530
|
+
return __generator(this, function (_d) {
|
|
531
|
+
switch (_d.label) {
|
|
532
|
+
case 0:
|
|
533
|
+
_a = [__assign({}, output)];
|
|
534
|
+
_c = {};
|
|
535
|
+
return [4, parseErrorBody(output.body, context)];
|
|
536
|
+
case 1:
|
|
537
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
538
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
539
|
+
_b = errorCode;
|
|
540
|
+
switch (_b) {
|
|
541
|
+
case "BadGatewayException": return [3, 2];
|
|
542
|
+
case "com.amazonaws.lexruntimeservice#BadGatewayException": return [3, 2];
|
|
543
|
+
case "BadRequestException": return [3, 4];
|
|
544
|
+
case "com.amazonaws.lexruntimeservice#BadRequestException": return [3, 4];
|
|
545
|
+
case "ConflictException": return [3, 6];
|
|
546
|
+
case "com.amazonaws.lexruntimeservice#ConflictException": return [3, 6];
|
|
547
|
+
case "DependencyFailedException": return [3, 8];
|
|
548
|
+
case "com.amazonaws.lexruntimeservice#DependencyFailedException": return [3, 8];
|
|
549
|
+
case "InternalFailureException": return [3, 10];
|
|
550
|
+
case "com.amazonaws.lexruntimeservice#InternalFailureException": return [3, 10];
|
|
551
|
+
case "LimitExceededException": return [3, 12];
|
|
552
|
+
case "com.amazonaws.lexruntimeservice#LimitExceededException": return [3, 12];
|
|
553
|
+
case "LoopDetectedException": return [3, 14];
|
|
554
|
+
case "com.amazonaws.lexruntimeservice#LoopDetectedException": return [3, 14];
|
|
555
|
+
case "NotFoundException": return [3, 16];
|
|
556
|
+
case "com.amazonaws.lexruntimeservice#NotFoundException": return [3, 16];
|
|
557
|
+
}
|
|
558
|
+
return [3, 18];
|
|
559
|
+
case 2: return [4, deserializeAws_restJson1BadGatewayExceptionResponse(parsedOutput, context)];
|
|
560
|
+
case 3: throw _d.sent();
|
|
561
|
+
case 4: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
|
|
562
|
+
case 5: throw _d.sent();
|
|
563
|
+
case 6: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
|
|
564
|
+
case 7: throw _d.sent();
|
|
565
|
+
case 8: return [4, deserializeAws_restJson1DependencyFailedExceptionResponse(parsedOutput, context)];
|
|
566
|
+
case 9: throw _d.sent();
|
|
567
|
+
case 10: return [4, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
|
|
568
|
+
case 11: throw _d.sent();
|
|
569
|
+
case 12: return [4, deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)];
|
|
570
|
+
case 13: throw _d.sent();
|
|
571
|
+
case 14: return [4, deserializeAws_restJson1LoopDetectedExceptionResponse(parsedOutput, context)];
|
|
572
|
+
case 15: throw _d.sent();
|
|
573
|
+
case 16: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
|
|
574
|
+
case 17: throw _d.sent();
|
|
575
|
+
case 18:
|
|
576
|
+
parsedBody = parsedOutput.body;
|
|
577
|
+
throwDefaultError({
|
|
578
|
+
output: output,
|
|
579
|
+
parsedBody: parsedBody,
|
|
580
|
+
exceptionCtor: __BaseException,
|
|
581
|
+
errorCode: errorCode,
|
|
582
|
+
});
|
|
583
|
+
_d.label = 19;
|
|
584
|
+
case 19: return [2];
|
|
585
|
+
}
|
|
578
586
|
});
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
587
|
+
}); };
|
|
588
|
+
export var deserializeAws_restJson1PutSessionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
589
|
+
var contents, data;
|
|
590
|
+
return __generator(this, function (_a) {
|
|
591
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
592
|
+
return [2, deserializeAws_restJson1PutSessionCommandError(output, context)];
|
|
593
|
+
}
|
|
594
|
+
contents = map({
|
|
595
|
+
$metadata: deserializeMetadata(output),
|
|
596
|
+
contentType: [, output.headers["content-type"]],
|
|
597
|
+
intentName: [, output.headers["x-amz-lex-intent-name"]],
|
|
598
|
+
slots: [
|
|
599
|
+
function () { return void 0 !== output.headers["x-amz-lex-slots"]; },
|
|
600
|
+
function () {
|
|
601
|
+
return new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-slots"])).toString("utf8"));
|
|
602
|
+
},
|
|
603
|
+
],
|
|
604
|
+
sessionAttributes: [
|
|
605
|
+
function () { return void 0 !== output.headers["x-amz-lex-session-attributes"]; },
|
|
606
|
+
function () {
|
|
607
|
+
return new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-session-attributes"])).toString("utf8"));
|
|
608
|
+
},
|
|
609
|
+
],
|
|
610
|
+
message: [, output.headers["x-amz-lex-message"]],
|
|
611
|
+
encodedMessage: [, output.headers["x-amz-lex-encoded-message"]],
|
|
612
|
+
messageFormat: [, output.headers["x-amz-lex-message-format"]],
|
|
613
|
+
dialogState: [, output.headers["x-amz-lex-dialog-state"]],
|
|
614
|
+
slotToElicit: [, output.headers["x-amz-lex-slot-to-elicit"]],
|
|
615
|
+
sessionId: [, output.headers["x-amz-lex-session-id"]],
|
|
616
|
+
activeContexts: [
|
|
617
|
+
function () { return void 0 !== output.headers["x-amz-lex-active-contexts"]; },
|
|
618
|
+
function () {
|
|
619
|
+
return new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-active-contexts"])).toString("utf8"));
|
|
620
|
+
},
|
|
621
|
+
],
|
|
622
|
+
});
|
|
623
|
+
data = output.body;
|
|
624
|
+
contents.audioStream = data;
|
|
625
|
+
return [2, contents];
|
|
584
626
|
});
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
627
|
+
}); };
|
|
628
|
+
var deserializeAws_restJson1PutSessionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
629
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
630
|
+
var _c;
|
|
631
|
+
return __generator(this, function (_d) {
|
|
632
|
+
switch (_d.label) {
|
|
633
|
+
case 0:
|
|
634
|
+
_a = [__assign({}, output)];
|
|
635
|
+
_c = {};
|
|
636
|
+
return [4, parseErrorBody(output.body, context)];
|
|
637
|
+
case 1:
|
|
638
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
639
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
640
|
+
_b = errorCode;
|
|
641
|
+
switch (_b) {
|
|
642
|
+
case "BadGatewayException": return [3, 2];
|
|
643
|
+
case "com.amazonaws.lexruntimeservice#BadGatewayException": return [3, 2];
|
|
644
|
+
case "BadRequestException": return [3, 4];
|
|
645
|
+
case "com.amazonaws.lexruntimeservice#BadRequestException": return [3, 4];
|
|
646
|
+
case "ConflictException": return [3, 6];
|
|
647
|
+
case "com.amazonaws.lexruntimeservice#ConflictException": return [3, 6];
|
|
648
|
+
case "DependencyFailedException": return [3, 8];
|
|
649
|
+
case "com.amazonaws.lexruntimeservice#DependencyFailedException": return [3, 8];
|
|
650
|
+
case "InternalFailureException": return [3, 10];
|
|
651
|
+
case "com.amazonaws.lexruntimeservice#InternalFailureException": return [3, 10];
|
|
652
|
+
case "LimitExceededException": return [3, 12];
|
|
653
|
+
case "com.amazonaws.lexruntimeservice#LimitExceededException": return [3, 12];
|
|
654
|
+
case "NotAcceptableException": return [3, 14];
|
|
655
|
+
case "com.amazonaws.lexruntimeservice#NotAcceptableException": return [3, 14];
|
|
656
|
+
case "NotFoundException": return [3, 16];
|
|
657
|
+
case "com.amazonaws.lexruntimeservice#NotFoundException": return [3, 16];
|
|
658
|
+
}
|
|
659
|
+
return [3, 18];
|
|
660
|
+
case 2: return [4, deserializeAws_restJson1BadGatewayExceptionResponse(parsedOutput, context)];
|
|
661
|
+
case 3: throw _d.sent();
|
|
662
|
+
case 4: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
|
|
663
|
+
case 5: throw _d.sent();
|
|
664
|
+
case 6: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
|
|
665
|
+
case 7: throw _d.sent();
|
|
666
|
+
case 8: return [4, deserializeAws_restJson1DependencyFailedExceptionResponse(parsedOutput, context)];
|
|
667
|
+
case 9: throw _d.sent();
|
|
668
|
+
case 10: return [4, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
|
|
669
|
+
case 11: throw _d.sent();
|
|
670
|
+
case 12: return [4, deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)];
|
|
671
|
+
case 13: throw _d.sent();
|
|
672
|
+
case 14: return [4, deserializeAws_restJson1NotAcceptableExceptionResponse(parsedOutput, context)];
|
|
673
|
+
case 15: throw _d.sent();
|
|
674
|
+
case 16: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
|
|
675
|
+
case 17: throw _d.sent();
|
|
676
|
+
case 18:
|
|
677
|
+
parsedBody = parsedOutput.body;
|
|
678
|
+
throwDefaultError({
|
|
679
|
+
output: output,
|
|
680
|
+
parsedBody: parsedBody,
|
|
681
|
+
exceptionCtor: __BaseException,
|
|
682
|
+
errorCode: errorCode,
|
|
683
|
+
});
|
|
684
|
+
_d.label = 19;
|
|
685
|
+
case 19: return [2];
|
|
686
|
+
}
|
|
592
687
|
});
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
688
|
+
}); };
|
|
689
|
+
var map = __map;
|
|
690
|
+
var deserializeAws_restJson1BadGatewayExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
691
|
+
var contents, data, exception;
|
|
692
|
+
return __generator(this, function (_a) {
|
|
693
|
+
contents = map({});
|
|
694
|
+
data = parsedOutput.body;
|
|
695
|
+
if (data.Message != null) {
|
|
696
|
+
contents.Message = __expectString(data.Message);
|
|
697
|
+
}
|
|
698
|
+
exception = new BadGatewayException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
699
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
604
700
|
});
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
615
|
-
|
|
701
|
+
}); };
|
|
702
|
+
var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
703
|
+
var contents, data, exception;
|
|
704
|
+
return __generator(this, function (_a) {
|
|
705
|
+
contents = map({});
|
|
706
|
+
data = parsedOutput.body;
|
|
707
|
+
if (data.message != null) {
|
|
708
|
+
contents.message = __expectString(data.message);
|
|
709
|
+
}
|
|
710
|
+
exception = new BadRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
711
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
616
712
|
});
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
627
|
-
|
|
713
|
+
}); };
|
|
714
|
+
var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
715
|
+
var contents, data, exception;
|
|
716
|
+
return __generator(this, function (_a) {
|
|
717
|
+
contents = map({});
|
|
718
|
+
data = parsedOutput.body;
|
|
719
|
+
if (data.message != null) {
|
|
720
|
+
contents.message = __expectString(data.message);
|
|
721
|
+
}
|
|
722
|
+
exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
723
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
628
724
|
});
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
639
|
-
|
|
725
|
+
}); };
|
|
726
|
+
var deserializeAws_restJson1DependencyFailedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
727
|
+
var contents, data, exception;
|
|
728
|
+
return __generator(this, function (_a) {
|
|
729
|
+
contents = map({});
|
|
730
|
+
data = parsedOutput.body;
|
|
731
|
+
if (data.Message != null) {
|
|
732
|
+
contents.Message = __expectString(data.Message);
|
|
733
|
+
}
|
|
734
|
+
exception = new DependencyFailedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
735
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
640
736
|
});
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
651
|
-
|
|
737
|
+
}); };
|
|
738
|
+
var deserializeAws_restJson1InternalFailureExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
739
|
+
var contents, data, exception;
|
|
740
|
+
return __generator(this, function (_a) {
|
|
741
|
+
contents = map({});
|
|
742
|
+
data = parsedOutput.body;
|
|
743
|
+
if (data.message != null) {
|
|
744
|
+
contents.message = __expectString(data.message);
|
|
745
|
+
}
|
|
746
|
+
exception = new InternalFailureException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
747
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
652
748
|
});
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
return {
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
}
|
|
664
|
-
|
|
749
|
+
}); };
|
|
750
|
+
var deserializeAws_restJson1LimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
751
|
+
var contents, data, exception;
|
|
752
|
+
return __generator(this, function (_a) {
|
|
753
|
+
contents = map({
|
|
754
|
+
retryAfterSeconds: [, parsedOutput.headers["retry-after"]],
|
|
755
|
+
});
|
|
756
|
+
data = parsedOutput.body;
|
|
757
|
+
if (data.message != null) {
|
|
758
|
+
contents.message = __expectString(data.message);
|
|
759
|
+
}
|
|
760
|
+
exception = new LimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
761
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
762
|
+
});
|
|
763
|
+
}); };
|
|
764
|
+
var deserializeAws_restJson1LoopDetectedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
765
|
+
var contents, data, exception;
|
|
766
|
+
return __generator(this, function (_a) {
|
|
767
|
+
contents = map({});
|
|
768
|
+
data = parsedOutput.body;
|
|
769
|
+
if (data.Message != null) {
|
|
770
|
+
contents.Message = __expectString(data.Message);
|
|
771
|
+
}
|
|
772
|
+
exception = new LoopDetectedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
773
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
774
|
+
});
|
|
775
|
+
}); };
|
|
776
|
+
var deserializeAws_restJson1NotAcceptableExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
777
|
+
var contents, data, exception;
|
|
778
|
+
return __generator(this, function (_a) {
|
|
779
|
+
contents = map({});
|
|
780
|
+
data = parsedOutput.body;
|
|
781
|
+
if (data.message != null) {
|
|
782
|
+
contents.message = __expectString(data.message);
|
|
783
|
+
}
|
|
784
|
+
exception = new NotAcceptableException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
785
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
786
|
+
});
|
|
787
|
+
}); };
|
|
788
|
+
var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
789
|
+
var contents, data, exception;
|
|
790
|
+
return __generator(this, function (_a) {
|
|
791
|
+
contents = map({});
|
|
792
|
+
data = parsedOutput.body;
|
|
793
|
+
if (data.message != null) {
|
|
794
|
+
contents.message = __expectString(data.message);
|
|
795
|
+
}
|
|
796
|
+
exception = new NotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
797
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
798
|
+
});
|
|
799
|
+
}); };
|
|
800
|
+
var deserializeAws_restJson1RequestTimeoutExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
801
|
+
var contents, data, exception;
|
|
802
|
+
return __generator(this, function (_a) {
|
|
803
|
+
contents = map({});
|
|
804
|
+
data = parsedOutput.body;
|
|
805
|
+
if (data.message != null) {
|
|
806
|
+
contents.message = __expectString(data.message);
|
|
807
|
+
}
|
|
808
|
+
exception = new RequestTimeoutException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
809
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
810
|
+
});
|
|
811
|
+
}); };
|
|
812
|
+
var deserializeAws_restJson1UnsupportedMediaTypeExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
813
|
+
var contents, data, exception;
|
|
814
|
+
return __generator(this, function (_a) {
|
|
815
|
+
contents = map({});
|
|
816
|
+
data = parsedOutput.body;
|
|
817
|
+
if (data.message != null) {
|
|
818
|
+
contents.message = __expectString(data.message);
|
|
819
|
+
}
|
|
820
|
+
exception = new UnsupportedMediaTypeException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
821
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
822
|
+
});
|
|
823
|
+
}); };
|
|
824
|
+
var serializeAws_restJson1ActiveContext = function (input, context) {
|
|
825
|
+
return __assign(__assign(__assign({}, (input.name != null && { name: input.name })), (input.parameters != null && {
|
|
826
|
+
parameters: serializeAws_restJson1ActiveContextParametersMap(input.parameters, context),
|
|
827
|
+
})), (input.timeToLive != null && {
|
|
828
|
+
timeToLive: serializeAws_restJson1ActiveContextTimeToLive(input.timeToLive, context),
|
|
829
|
+
}));
|
|
665
830
|
};
|
|
666
|
-
|
|
667
|
-
return Object.entries(input).reduce((acc,
|
|
831
|
+
var serializeAws_restJson1ActiveContextParametersMap = function (input, context) {
|
|
832
|
+
return Object.entries(input).reduce(function (acc, _a) {
|
|
833
|
+
var _b;
|
|
834
|
+
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
668
835
|
if (value === null) {
|
|
669
836
|
return acc;
|
|
670
837
|
}
|
|
671
|
-
return {
|
|
672
|
-
...acc,
|
|
673
|
-
[key]: value,
|
|
674
|
-
};
|
|
838
|
+
return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
|
|
675
839
|
}, {});
|
|
676
840
|
};
|
|
677
|
-
|
|
841
|
+
var serializeAws_restJson1ActiveContextsList = function (input, context) {
|
|
678
842
|
return input
|
|
679
|
-
.filter((e)
|
|
680
|
-
.map((entry)
|
|
843
|
+
.filter(function (e) { return e != null; })
|
|
844
|
+
.map(function (entry) {
|
|
681
845
|
return serializeAws_restJson1ActiveContext(entry, context);
|
|
682
846
|
});
|
|
683
847
|
};
|
|
684
|
-
|
|
685
|
-
return {
|
|
686
|
-
...(input.timeToLiveInSeconds != null && { timeToLiveInSeconds: input.timeToLiveInSeconds }),
|
|
687
|
-
...(input.turnsToLive != null && { turnsToLive: input.turnsToLive }),
|
|
688
|
-
};
|
|
848
|
+
var serializeAws_restJson1ActiveContextTimeToLive = function (input, context) {
|
|
849
|
+
return __assign(__assign({}, (input.timeToLiveInSeconds != null && { timeToLiveInSeconds: input.timeToLiveInSeconds })), (input.turnsToLive != null && { turnsToLive: input.turnsToLive }));
|
|
689
850
|
};
|
|
690
|
-
|
|
691
|
-
return {
|
|
692
|
-
...(input.fulfillmentState != null && { fulfillmentState: input.fulfillmentState }),
|
|
693
|
-
...(input.intentName != null && { intentName: input.intentName }),
|
|
694
|
-
...(input.message != null && { message: input.message }),
|
|
695
|
-
...(input.messageFormat != null && { messageFormat: input.messageFormat }),
|
|
696
|
-
...(input.slotToElicit != null && { slotToElicit: input.slotToElicit }),
|
|
697
|
-
...(input.slots != null && { slots: serializeAws_restJson1StringMap(input.slots, context) }),
|
|
698
|
-
...(input.type != null && { type: input.type }),
|
|
699
|
-
};
|
|
851
|
+
var serializeAws_restJson1DialogAction = function (input, context) {
|
|
852
|
+
return __assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.fulfillmentState != null && { fulfillmentState: input.fulfillmentState })), (input.intentName != null && { intentName: input.intentName })), (input.message != null && { message: input.message })), (input.messageFormat != null && { messageFormat: input.messageFormat })), (input.slotToElicit != null && { slotToElicit: input.slotToElicit })), (input.slots != null && { slots: serializeAws_restJson1StringMap(input.slots, context) })), (input.type != null && { type: input.type }));
|
|
700
853
|
};
|
|
701
|
-
|
|
702
|
-
return {
|
|
703
|
-
...(input.checkpointLabel != null && { checkpointLabel: input.checkpointLabel }),
|
|
704
|
-
...(input.confirmationStatus != null && { confirmationStatus: input.confirmationStatus }),
|
|
705
|
-
...(input.dialogActionType != null && { dialogActionType: input.dialogActionType }),
|
|
706
|
-
...(input.fulfillmentState != null && { fulfillmentState: input.fulfillmentState }),
|
|
707
|
-
...(input.intentName != null && { intentName: input.intentName }),
|
|
708
|
-
...(input.slotToElicit != null && { slotToElicit: input.slotToElicit }),
|
|
709
|
-
...(input.slots != null && { slots: serializeAws_restJson1StringMap(input.slots, context) }),
|
|
710
|
-
};
|
|
854
|
+
var serializeAws_restJson1IntentSummary = function (input, context) {
|
|
855
|
+
return __assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.checkpointLabel != null && { checkpointLabel: input.checkpointLabel })), (input.confirmationStatus != null && { confirmationStatus: input.confirmationStatus })), (input.dialogActionType != null && { dialogActionType: input.dialogActionType })), (input.fulfillmentState != null && { fulfillmentState: input.fulfillmentState })), (input.intentName != null && { intentName: input.intentName })), (input.slotToElicit != null && { slotToElicit: input.slotToElicit })), (input.slots != null && { slots: serializeAws_restJson1StringMap(input.slots, context) }));
|
|
711
856
|
};
|
|
712
|
-
|
|
857
|
+
var serializeAws_restJson1IntentSummaryList = function (input, context) {
|
|
713
858
|
return input
|
|
714
|
-
.filter((e)
|
|
715
|
-
.map((entry)
|
|
859
|
+
.filter(function (e) { return e != null; })
|
|
860
|
+
.map(function (entry) {
|
|
716
861
|
return serializeAws_restJson1IntentSummary(entry, context);
|
|
717
862
|
});
|
|
718
863
|
};
|
|
719
|
-
|
|
720
|
-
return Object.entries(input).reduce((acc,
|
|
864
|
+
var serializeAws_restJson1StringMap = function (input, context) {
|
|
865
|
+
return Object.entries(input).reduce(function (acc, _a) {
|
|
866
|
+
var _b;
|
|
867
|
+
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
721
868
|
if (value === null) {
|
|
722
869
|
return acc;
|
|
723
870
|
}
|
|
724
|
-
return {
|
|
725
|
-
...acc,
|
|
726
|
-
[key]: value,
|
|
727
|
-
};
|
|
871
|
+
return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
|
|
728
872
|
}, {});
|
|
729
873
|
};
|
|
730
|
-
|
|
874
|
+
var deserializeAws_restJson1ActiveContext = function (output, context) {
|
|
731
875
|
return {
|
|
732
876
|
name: __expectString(output.name),
|
|
733
877
|
parameters: output.parameters != null
|
|
@@ -738,21 +882,20 @@ const deserializeAws_restJson1ActiveContext = (output, context) => {
|
|
|
738
882
|
: undefined,
|
|
739
883
|
};
|
|
740
884
|
};
|
|
741
|
-
|
|
742
|
-
return Object.entries(output).reduce((acc,
|
|
885
|
+
var deserializeAws_restJson1ActiveContextParametersMap = function (output, context) {
|
|
886
|
+
return Object.entries(output).reduce(function (acc, _a) {
|
|
887
|
+
var _b;
|
|
888
|
+
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
743
889
|
if (value === null) {
|
|
744
890
|
return acc;
|
|
745
891
|
}
|
|
746
|
-
return {
|
|
747
|
-
...acc,
|
|
748
|
-
[key]: __expectString(value),
|
|
749
|
-
};
|
|
892
|
+
return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
|
|
750
893
|
}, {});
|
|
751
894
|
};
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
.filter((e)
|
|
755
|
-
.map((entry)
|
|
895
|
+
var deserializeAws_restJson1ActiveContextsList = function (output, context) {
|
|
896
|
+
var retVal = (output || [])
|
|
897
|
+
.filter(function (e) { return e != null; })
|
|
898
|
+
.map(function (entry) {
|
|
756
899
|
if (entry === null) {
|
|
757
900
|
return null;
|
|
758
901
|
}
|
|
@@ -760,19 +903,19 @@ const deserializeAws_restJson1ActiveContextsList = (output, context) => {
|
|
|
760
903
|
});
|
|
761
904
|
return retVal;
|
|
762
905
|
};
|
|
763
|
-
|
|
906
|
+
var deserializeAws_restJson1ActiveContextTimeToLive = function (output, context) {
|
|
764
907
|
return {
|
|
765
908
|
timeToLiveInSeconds: __expectInt32(output.timeToLiveInSeconds),
|
|
766
909
|
turnsToLive: __expectInt32(output.turnsToLive),
|
|
767
910
|
};
|
|
768
911
|
};
|
|
769
|
-
|
|
912
|
+
var deserializeAws_restJson1Button = function (output, context) {
|
|
770
913
|
return {
|
|
771
914
|
text: __expectString(output.text),
|
|
772
915
|
value: __expectString(output.value),
|
|
773
916
|
};
|
|
774
917
|
};
|
|
775
|
-
|
|
918
|
+
var deserializeAws_restJson1DialogAction = function (output, context) {
|
|
776
919
|
return {
|
|
777
920
|
fulfillmentState: __expectString(output.fulfillmentState),
|
|
778
921
|
intentName: __expectString(output.intentName),
|
|
@@ -783,7 +926,7 @@ const deserializeAws_restJson1DialogAction = (output, context) => {
|
|
|
783
926
|
type: __expectString(output.type),
|
|
784
927
|
};
|
|
785
928
|
};
|
|
786
|
-
|
|
929
|
+
var deserializeAws_restJson1GenericAttachment = function (output, context) {
|
|
787
930
|
return {
|
|
788
931
|
attachmentLinkUrl: __expectString(output.attachmentLinkUrl),
|
|
789
932
|
buttons: output.buttons != null ? deserializeAws_restJson1listOfButtons(output.buttons, context) : undefined,
|
|
@@ -792,10 +935,10 @@ const deserializeAws_restJson1GenericAttachment = (output, context) => {
|
|
|
792
935
|
title: __expectString(output.title),
|
|
793
936
|
};
|
|
794
937
|
};
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
.filter((e)
|
|
798
|
-
.map((entry)
|
|
938
|
+
var deserializeAws_restJson1genericAttachmentList = function (output, context) {
|
|
939
|
+
var retVal = (output || [])
|
|
940
|
+
.filter(function (e) { return e != null; })
|
|
941
|
+
.map(function (entry) {
|
|
799
942
|
if (entry === null) {
|
|
800
943
|
return null;
|
|
801
944
|
}
|
|
@@ -803,15 +946,15 @@ const deserializeAws_restJson1genericAttachmentList = (output, context) => {
|
|
|
803
946
|
});
|
|
804
947
|
return retVal;
|
|
805
948
|
};
|
|
806
|
-
|
|
949
|
+
var deserializeAws_restJson1IntentConfidence = function (output, context) {
|
|
807
950
|
return {
|
|
808
951
|
score: __limitedParseDouble(output.score),
|
|
809
952
|
};
|
|
810
953
|
};
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
.filter((e)
|
|
814
|
-
.map((entry)
|
|
954
|
+
var deserializeAws_restJson1IntentList = function (output, context) {
|
|
955
|
+
var retVal = (output || [])
|
|
956
|
+
.filter(function (e) { return e != null; })
|
|
957
|
+
.map(function (entry) {
|
|
815
958
|
if (entry === null) {
|
|
816
959
|
return null;
|
|
817
960
|
}
|
|
@@ -819,7 +962,7 @@ const deserializeAws_restJson1IntentList = (output, context) => {
|
|
|
819
962
|
});
|
|
820
963
|
return retVal;
|
|
821
964
|
};
|
|
822
|
-
|
|
965
|
+
var deserializeAws_restJson1IntentSummary = function (output, context) {
|
|
823
966
|
return {
|
|
824
967
|
checkpointLabel: __expectString(output.checkpointLabel),
|
|
825
968
|
confirmationStatus: __expectString(output.confirmationStatus),
|
|
@@ -830,10 +973,10 @@ const deserializeAws_restJson1IntentSummary = (output, context) => {
|
|
|
830
973
|
slots: output.slots != null ? deserializeAws_restJson1StringMap(output.slots, context) : undefined,
|
|
831
974
|
};
|
|
832
975
|
};
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
.filter((e)
|
|
836
|
-
.map((entry)
|
|
976
|
+
var deserializeAws_restJson1IntentSummaryList = function (output, context) {
|
|
977
|
+
var retVal = (output || [])
|
|
978
|
+
.filter(function (e) { return e != null; })
|
|
979
|
+
.map(function (entry) {
|
|
837
980
|
if (entry === null) {
|
|
838
981
|
return null;
|
|
839
982
|
}
|
|
@@ -841,10 +984,10 @@ const deserializeAws_restJson1IntentSummaryList = (output, context) => {
|
|
|
841
984
|
});
|
|
842
985
|
return retVal;
|
|
843
986
|
};
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
.filter((e)
|
|
847
|
-
.map((entry)
|
|
987
|
+
var deserializeAws_restJson1listOfButtons = function (output, context) {
|
|
988
|
+
var retVal = (output || [])
|
|
989
|
+
.filter(function (e) { return e != null; })
|
|
990
|
+
.map(function (entry) {
|
|
848
991
|
if (entry === null) {
|
|
849
992
|
return null;
|
|
850
993
|
}
|
|
@@ -852,7 +995,7 @@ const deserializeAws_restJson1listOfButtons = (output, context) => {
|
|
|
852
995
|
});
|
|
853
996
|
return retVal;
|
|
854
997
|
};
|
|
855
|
-
|
|
998
|
+
var deserializeAws_restJson1PredictedIntent = function (output, context) {
|
|
856
999
|
return {
|
|
857
1000
|
intentName: __expectString(output.intentName),
|
|
858
1001
|
nluIntentConfidence: output.nluIntentConfidence != null
|
|
@@ -861,7 +1004,7 @@ const deserializeAws_restJson1PredictedIntent = (output, context) => {
|
|
|
861
1004
|
slots: output.slots != null ? deserializeAws_restJson1StringMap(output.slots, context) : undefined,
|
|
862
1005
|
};
|
|
863
1006
|
};
|
|
864
|
-
|
|
1007
|
+
var deserializeAws_restJson1ResponseCard = function (output, context) {
|
|
865
1008
|
return {
|
|
866
1009
|
contentType: __expectString(output.contentType),
|
|
867
1010
|
genericAttachments: output.genericAttachments != null
|
|
@@ -870,56 +1013,73 @@ const deserializeAws_restJson1ResponseCard = (output, context) => {
|
|
|
870
1013
|
version: __expectString(output.version),
|
|
871
1014
|
};
|
|
872
1015
|
};
|
|
873
|
-
|
|
1016
|
+
var deserializeAws_restJson1SentimentResponse = function (output, context) {
|
|
874
1017
|
return {
|
|
875
1018
|
sentimentLabel: __expectString(output.sentimentLabel),
|
|
876
1019
|
sentimentScore: __expectString(output.sentimentScore),
|
|
877
1020
|
};
|
|
878
1021
|
};
|
|
879
|
-
|
|
880
|
-
return Object.entries(output).reduce((acc,
|
|
1022
|
+
var deserializeAws_restJson1StringMap = function (output, context) {
|
|
1023
|
+
return Object.entries(output).reduce(function (acc, _a) {
|
|
1024
|
+
var _b;
|
|
1025
|
+
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
881
1026
|
if (value === null) {
|
|
882
1027
|
return acc;
|
|
883
1028
|
}
|
|
884
|
-
return {
|
|
885
|
-
...acc,
|
|
886
|
-
[key]: __expectString(value),
|
|
887
|
-
};
|
|
1029
|
+
return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
|
|
888
1030
|
}, {});
|
|
889
1031
|
};
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
1032
|
+
var deserializeMetadata = function (output) {
|
|
1033
|
+
var _a, _b;
|
|
1034
|
+
return ({
|
|
1035
|
+
httpStatusCode: output.statusCode,
|
|
1036
|
+
requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"],
|
|
1037
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
1038
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
1039
|
+
});
|
|
1040
|
+
};
|
|
1041
|
+
var collectBody = function (streamBody, context) {
|
|
1042
|
+
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
897
1043
|
if (streamBody instanceof Uint8Array) {
|
|
898
1044
|
return Promise.resolve(streamBody);
|
|
899
1045
|
}
|
|
900
1046
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
901
1047
|
};
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
}
|
|
912
|
-
return {};
|
|
913
|
-
});
|
|
914
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
915
|
-
const value = await parseBody(errorBody, context);
|
|
916
|
-
value.message = value.message ?? value.Message;
|
|
917
|
-
return value;
|
|
1048
|
+
var collectBodyString = function (streamBody, context) {
|
|
1049
|
+
return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
|
|
1050
|
+
};
|
|
1051
|
+
var isSerializableHeaderValue = function (value) {
|
|
1052
|
+
return value !== undefined &&
|
|
1053
|
+
value !== null &&
|
|
1054
|
+
value !== "" &&
|
|
1055
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
1056
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
918
1057
|
};
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
1058
|
+
var parseBody = function (streamBody, context) {
|
|
1059
|
+
return collectBodyString(streamBody, context).then(function (encoded) {
|
|
1060
|
+
if (encoded.length) {
|
|
1061
|
+
return JSON.parse(encoded);
|
|
1062
|
+
}
|
|
1063
|
+
return {};
|
|
1064
|
+
});
|
|
1065
|
+
};
|
|
1066
|
+
var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1067
|
+
var value;
|
|
1068
|
+
var _a;
|
|
1069
|
+
return __generator(this, function (_b) {
|
|
1070
|
+
switch (_b.label) {
|
|
1071
|
+
case 0: return [4, parseBody(errorBody, context)];
|
|
1072
|
+
case 1:
|
|
1073
|
+
value = _b.sent();
|
|
1074
|
+
value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
|
|
1075
|
+
return [2, value];
|
|
1076
|
+
}
|
|
1077
|
+
});
|
|
1078
|
+
}); };
|
|
1079
|
+
var loadRestJsonErrorCode = function (output, data) {
|
|
1080
|
+
var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
|
|
1081
|
+
var sanitizeErrorCode = function (rawValue) {
|
|
1082
|
+
var cleanValue = rawValue;
|
|
923
1083
|
if (typeof cleanValue === "number") {
|
|
924
1084
|
cleanValue = cleanValue.toString();
|
|
925
1085
|
}
|
|
@@ -934,7 +1094,7 @@ const loadRestJsonErrorCode = (output, data) => {
|
|
|
934
1094
|
}
|
|
935
1095
|
return cleanValue;
|
|
936
1096
|
};
|
|
937
|
-
|
|
1097
|
+
var headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
938
1098
|
if (headerKey !== undefined) {
|
|
939
1099
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
940
1100
|
}
|