@aws-sdk/client-lex-runtime-service 3.30.0 → 3.34.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 +35 -0
- package/dist/cjs/LexRuntimeService.spec.js +1 -1
- package/dist/cjs/LexRuntimeService.spec.js.map +1 -1
- package/dist/cjs/LexRuntimeServiceClient.js +13 -13
- package/dist/cjs/LexRuntimeServiceClient.js.map +1 -1
- package/dist/cjs/commands/DeleteSessionCommand.js +3 -3
- package/dist/cjs/commands/DeleteSessionCommand.js.map +1 -1
- package/dist/cjs/commands/GetSessionCommand.js +3 -3
- package/dist/cjs/commands/GetSessionCommand.js.map +1 -1
- package/dist/cjs/commands/PostContentCommand.js +3 -3
- package/dist/cjs/commands/PostContentCommand.js.map +1 -1
- package/dist/cjs/commands/PostTextCommand.js +3 -3
- package/dist/cjs/commands/PostTextCommand.js.map +1 -1
- package/dist/cjs/commands/PutSessionCommand.js +3 -3
- package/dist/cjs/commands/PutSessionCommand.js.map +1 -1
- package/dist/cjs/endpoints.js +1 -1
- package/dist/cjs/endpoints.js.map +1 -1
- package/dist/cjs/index.js +8 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/models/index.js +1 -1
- package/dist/cjs/models/index.js.map +1 -1
- package/dist/cjs/package.json +40 -40
- package/dist/cjs/protocols/Aws_restJson1.js +81 -81
- package/dist/cjs/protocols/Aws_restJson1.js.map +1 -1
- package/dist/cjs/runtimeConfig.browser.js +4 -4
- package/dist/cjs/runtimeConfig.browser.js.map +1 -1
- package/dist/cjs/runtimeConfig.js +8 -8
- package/dist/cjs/runtimeConfig.js.map +1 -1
- package/dist/cjs/runtimeConfig.native.js +1 -1
- package/dist/cjs/runtimeConfig.native.js.map +1 -1
- package/dist/es/LexRuntimeService.js +1 -15
- package/dist/es/LexRuntimeService.js.map +1 -1
- package/dist/es/LexRuntimeService.spec.js +2 -4
- package/dist/es/LexRuntimeService.spec.js.map +1 -1
- package/dist/es/LexRuntimeServiceClient.js +1 -20
- package/dist/es/LexRuntimeServiceClient.js.map +1 -1
- package/dist/es/commands/DeleteSessionCommand.js +2 -28
- package/dist/es/commands/DeleteSessionCommand.js.map +1 -1
- package/dist/es/commands/GetSessionCommand.js +2 -28
- package/dist/es/commands/GetSessionCommand.js.map +1 -1
- package/dist/es/commands/PostContentCommand.js +2 -103
- package/dist/es/commands/PostContentCommand.js.map +1 -1
- package/dist/es/commands/PostTextCommand.js +2 -102
- package/dist/es/commands/PostTextCommand.js.map +1 -1
- package/dist/es/commands/PutSessionCommand.js +2 -31
- package/dist/es/commands/PutSessionCommand.js.map +1 -1
- package/dist/es/endpoints.js +1 -1
- package/dist/es/endpoints.js.map +1 -1
- package/dist/es/models/models_0.js +0 -93
- package/dist/es/models/models_0.js.map +1 -1
- package/dist/es/package.json +40 -40
- package/dist/es/protocols/Aws_restJson1.js +204 -209
- package/dist/es/protocols/Aws_restJson1.js.map +1 -1
- package/dist/es/runtimeConfig.browser.js +0 -3
- package/dist/es/runtimeConfig.browser.js.map +1 -1
- package/dist/es/runtimeConfig.js +0 -3
- package/dist/es/runtimeConfig.js.map +1 -1
- package/dist/es/runtimeConfig.native.js +0 -3
- package/dist/es/runtimeConfig.native.js.map +1 -1
- package/dist/es/runtimeConfig.shared.js +0 -3
- package/dist/es/runtimeConfig.shared.js.map +1 -1
- 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/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 -40
- package/protocols/Aws_restJson1.ts +19 -13
- package/tsconfig.es.json +0 -2
- package/tsconfig.json +3 -5
- package/tsconfig.types.json +8 -0
|
@@ -5,7 +5,7 @@ export var serializeAws_restJson1DeleteSessionCommand = function (input, context
|
|
|
5
5
|
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, body;
|
|
6
6
|
return __generator(this, function (_c) {
|
|
7
7
|
switch (_c.label) {
|
|
8
|
-
case 0: return [4
|
|
8
|
+
case 0: return [4, context.endpoint()];
|
|
9
9
|
case 1:
|
|
10
10
|
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
11
11
|
headers = {};
|
|
@@ -41,7 +41,7 @@ export var serializeAws_restJson1DeleteSessionCommand = function (input, context
|
|
|
41
41
|
else {
|
|
42
42
|
throw new Error("No value provided for input HTTP label: userId.");
|
|
43
43
|
}
|
|
44
|
-
return [2
|
|
44
|
+
return [2, new __HttpRequest({
|
|
45
45
|
protocol: protocol,
|
|
46
46
|
hostname: hostname,
|
|
47
47
|
port: port,
|
|
@@ -57,7 +57,7 @@ export var serializeAws_restJson1GetSessionCommand = function (input, context) {
|
|
|
57
57
|
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, query, body;
|
|
58
58
|
return __generator(this, function (_c) {
|
|
59
59
|
switch (_c.label) {
|
|
60
|
-
case 0: return [4
|
|
60
|
+
case 0: return [4, context.endpoint()];
|
|
61
61
|
case 1:
|
|
62
62
|
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
63
63
|
headers = {};
|
|
@@ -94,7 +94,7 @@ export var serializeAws_restJson1GetSessionCommand = function (input, context) {
|
|
|
94
94
|
throw new Error("No value provided for input HTTP label: userId.");
|
|
95
95
|
}
|
|
96
96
|
query = __assign({}, (input.checkpointLabelFilter !== undefined && { checkpointLabelFilter: input.checkpointLabelFilter }));
|
|
97
|
-
return [2
|
|
97
|
+
return [2, new __HttpRequest({
|
|
98
98
|
protocol: protocol,
|
|
99
99
|
hostname: hostname,
|
|
100
100
|
port: port,
|
|
@@ -111,15 +111,15 @@ export var serializeAws_restJson1PostContentCommand = function (input, context)
|
|
|
111
111
|
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, body;
|
|
112
112
|
return __generator(this, function (_c) {
|
|
113
113
|
switch (_c.label) {
|
|
114
|
-
case 0: return [4
|
|
114
|
+
case 0: return [4, context.endpoint()];
|
|
115
115
|
case 1:
|
|
116
116
|
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
117
117
|
headers = __assign(__assign(__assign(__assign(__assign({ "content-type": "application/octet-stream", "x-amz-content-sha256": "UNSIGNED-PAYLOAD" }, (isSerializableHeaderValue(input.sessionAttributes) && {
|
|
118
|
-
"x-amz-lex-session-attributes": Buffer.from(__LazyJsonString.fromObject(input.sessionAttributes))
|
|
118
|
+
"x-amz-lex-session-attributes": context.base64Encoder(Buffer.from(__LazyJsonString.fromObject(input.sessionAttributes))),
|
|
119
119
|
})), (isSerializableHeaderValue(input.requestAttributes) && {
|
|
120
|
-
"x-amz-lex-request-attributes": Buffer.from(__LazyJsonString.fromObject(input.requestAttributes))
|
|
120
|
+
"x-amz-lex-request-attributes": context.base64Encoder(Buffer.from(__LazyJsonString.fromObject(input.requestAttributes))),
|
|
121
121
|
})), (isSerializableHeaderValue(input.contentType) && { "content-type": input.contentType })), (isSerializableHeaderValue(input.accept) && { accept: input.accept })), (isSerializableHeaderValue(input.activeContexts) && {
|
|
122
|
-
"x-amz-lex-active-contexts": Buffer.from(__LazyJsonString.fromObject(input.activeContexts))
|
|
122
|
+
"x-amz-lex-active-contexts": context.base64Encoder(Buffer.from(__LazyJsonString.fromObject(input.activeContexts))),
|
|
123
123
|
}));
|
|
124
124
|
resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
|
|
125
125
|
"/bot/{botName}/alias/{botAlias}/user/{userId}/content";
|
|
@@ -156,7 +156,7 @@ export var serializeAws_restJson1PostContentCommand = function (input, context)
|
|
|
156
156
|
if (input.inputStream !== undefined) {
|
|
157
157
|
body = input.inputStream;
|
|
158
158
|
}
|
|
159
|
-
return [2
|
|
159
|
+
return [2, new __HttpRequest({
|
|
160
160
|
protocol: protocol,
|
|
161
161
|
hostname: hostname,
|
|
162
162
|
port: port,
|
|
@@ -172,7 +172,7 @@ export var serializeAws_restJson1PostTextCommand = function (input, context) { r
|
|
|
172
172
|
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, body;
|
|
173
173
|
return __generator(this, function (_c) {
|
|
174
174
|
switch (_c.label) {
|
|
175
|
-
case 0: return [4
|
|
175
|
+
case 0: return [4, context.endpoint()];
|
|
176
176
|
case 1:
|
|
177
177
|
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
178
178
|
headers = {
|
|
@@ -220,7 +220,7 @@ export var serializeAws_restJson1PostTextCommand = function (input, context) { r
|
|
|
220
220
|
input.sessionAttributes !== null && {
|
|
221
221
|
sessionAttributes: serializeAws_restJson1StringMap(input.sessionAttributes, context),
|
|
222
222
|
})));
|
|
223
|
-
return [2
|
|
223
|
+
return [2, new __HttpRequest({
|
|
224
224
|
protocol: protocol,
|
|
225
225
|
hostname: hostname,
|
|
226
226
|
port: port,
|
|
@@ -236,7 +236,7 @@ export var serializeAws_restJson1PutSessionCommand = function (input, context) {
|
|
|
236
236
|
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, body;
|
|
237
237
|
return __generator(this, function (_c) {
|
|
238
238
|
switch (_c.label) {
|
|
239
|
-
case 0: return [4
|
|
239
|
+
case 0: return [4, context.endpoint()];
|
|
240
240
|
case 1:
|
|
241
241
|
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
242
242
|
headers = __assign({ "content-type": "application/json" }, (isSerializableHeaderValue(input.accept) && { accept: input.accept }));
|
|
@@ -283,7 +283,7 @@ export var serializeAws_restJson1PutSessionCommand = function (input, context) {
|
|
|
283
283
|
input.sessionAttributes !== null && {
|
|
284
284
|
sessionAttributes: serializeAws_restJson1StringMap(input.sessionAttributes, context),
|
|
285
285
|
})));
|
|
286
|
-
return [2
|
|
286
|
+
return [2, new __HttpRequest({
|
|
287
287
|
protocol: protocol,
|
|
288
288
|
hostname: hostname,
|
|
289
289
|
port: port,
|
|
@@ -301,7 +301,7 @@ export var deserializeAws_restJson1DeleteSessionCommand = function (output, cont
|
|
|
301
301
|
switch (_c.label) {
|
|
302
302
|
case 0:
|
|
303
303
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
304
|
-
return [2
|
|
304
|
+
return [2, deserializeAws_restJson1DeleteSessionCommandError(output, context)];
|
|
305
305
|
}
|
|
306
306
|
contents = {
|
|
307
307
|
$metadata: deserializeMetadata(output),
|
|
@@ -312,7 +312,7 @@ export var deserializeAws_restJson1DeleteSessionCommand = function (output, cont
|
|
|
312
312
|
};
|
|
313
313
|
_a = __expectNonNull;
|
|
314
314
|
_b = __expectObject;
|
|
315
|
-
return [4
|
|
315
|
+
return [4, parseBody(output.body, context)];
|
|
316
316
|
case 1:
|
|
317
317
|
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
318
318
|
if (data.botAlias !== undefined && data.botAlias !== null) {
|
|
@@ -327,7 +327,7 @@ export var deserializeAws_restJson1DeleteSessionCommand = function (output, cont
|
|
|
327
327
|
if (data.userId !== undefined && data.userId !== null) {
|
|
328
328
|
contents.userId = __expectString(data.userId);
|
|
329
329
|
}
|
|
330
|
-
return [2
|
|
330
|
+
return [2, Promise.resolve(contents)];
|
|
331
331
|
}
|
|
332
332
|
});
|
|
333
333
|
}); };
|
|
@@ -339,55 +339,55 @@ var deserializeAws_restJson1DeleteSessionCommandError = function (output, contex
|
|
|
339
339
|
case 0:
|
|
340
340
|
_a = [__assign({}, output)];
|
|
341
341
|
_h = {};
|
|
342
|
-
return [4
|
|
342
|
+
return [4, parseBody(output.body, context)];
|
|
343
343
|
case 1:
|
|
344
344
|
parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));
|
|
345
345
|
errorCode = "UnknownError";
|
|
346
346
|
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
347
347
|
_b = errorCode;
|
|
348
348
|
switch (_b) {
|
|
349
|
-
case "BadRequestException": return [3
|
|
350
|
-
case "com.amazonaws.lexruntimeservice#BadRequestException": return [3
|
|
351
|
-
case "ConflictException": return [3
|
|
352
|
-
case "com.amazonaws.lexruntimeservice#ConflictException": return [3
|
|
353
|
-
case "InternalFailureException": return [3
|
|
354
|
-
case "com.amazonaws.lexruntimeservice#InternalFailureException": return [3
|
|
355
|
-
case "LimitExceededException": return [3
|
|
356
|
-
case "com.amazonaws.lexruntimeservice#LimitExceededException": return [3
|
|
357
|
-
case "NotFoundException": return [3
|
|
358
|
-
case "com.amazonaws.lexruntimeservice#NotFoundException": return [3
|
|
349
|
+
case "BadRequestException": return [3, 2];
|
|
350
|
+
case "com.amazonaws.lexruntimeservice#BadRequestException": return [3, 2];
|
|
351
|
+
case "ConflictException": return [3, 4];
|
|
352
|
+
case "com.amazonaws.lexruntimeservice#ConflictException": return [3, 4];
|
|
353
|
+
case "InternalFailureException": return [3, 6];
|
|
354
|
+
case "com.amazonaws.lexruntimeservice#InternalFailureException": return [3, 6];
|
|
355
|
+
case "LimitExceededException": return [3, 8];
|
|
356
|
+
case "com.amazonaws.lexruntimeservice#LimitExceededException": return [3, 8];
|
|
357
|
+
case "NotFoundException": return [3, 10];
|
|
358
|
+
case "com.amazonaws.lexruntimeservice#NotFoundException": return [3, 10];
|
|
359
359
|
}
|
|
360
|
-
return [3
|
|
360
|
+
return [3, 12];
|
|
361
361
|
case 2:
|
|
362
362
|
_c = [{}];
|
|
363
|
-
return [4
|
|
363
|
+
return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
|
|
364
364
|
case 3:
|
|
365
365
|
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
366
|
-
return [3
|
|
366
|
+
return [3, 13];
|
|
367
367
|
case 4:
|
|
368
368
|
_d = [{}];
|
|
369
|
-
return [4
|
|
369
|
+
return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
|
|
370
370
|
case 5:
|
|
371
371
|
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
372
|
-
return [3
|
|
372
|
+
return [3, 13];
|
|
373
373
|
case 6:
|
|
374
374
|
_e = [{}];
|
|
375
|
-
return [4
|
|
375
|
+
return [4, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
|
|
376
376
|
case 7:
|
|
377
377
|
response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
378
|
-
return [3
|
|
378
|
+
return [3, 13];
|
|
379
379
|
case 8:
|
|
380
380
|
_f = [{}];
|
|
381
|
-
return [4
|
|
381
|
+
return [4, deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)];
|
|
382
382
|
case 9:
|
|
383
383
|
response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
384
|
-
return [3
|
|
384
|
+
return [3, 13];
|
|
385
385
|
case 10:
|
|
386
386
|
_g = [{}];
|
|
387
|
-
return [4
|
|
387
|
+
return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
|
|
388
388
|
case 11:
|
|
389
389
|
response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
390
|
-
return [3
|
|
390
|
+
return [3, 13];
|
|
391
391
|
case 12:
|
|
392
392
|
parsedBody = parsedOutput.body;
|
|
393
393
|
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
@@ -397,7 +397,7 @@ var deserializeAws_restJson1DeleteSessionCommandError = function (output, contex
|
|
|
397
397
|
message = response.message || response.Message || errorCode;
|
|
398
398
|
response.message = message;
|
|
399
399
|
delete response.Message;
|
|
400
|
-
return [2
|
|
400
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
401
401
|
}
|
|
402
402
|
});
|
|
403
403
|
}); };
|
|
@@ -407,7 +407,7 @@ export var deserializeAws_restJson1GetSessionCommand = function (output, context
|
|
|
407
407
|
switch (_c.label) {
|
|
408
408
|
case 0:
|
|
409
409
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
410
|
-
return [2
|
|
410
|
+
return [2, deserializeAws_restJson1GetSessionCommandError(output, context)];
|
|
411
411
|
}
|
|
412
412
|
contents = {
|
|
413
413
|
$metadata: deserializeMetadata(output),
|
|
@@ -419,7 +419,7 @@ export var deserializeAws_restJson1GetSessionCommand = function (output, context
|
|
|
419
419
|
};
|
|
420
420
|
_a = __expectNonNull;
|
|
421
421
|
_b = __expectObject;
|
|
422
|
-
return [4
|
|
422
|
+
return [4, parseBody(output.body, context)];
|
|
423
423
|
case 1:
|
|
424
424
|
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
425
425
|
if (data.activeContexts !== undefined && data.activeContexts !== null) {
|
|
@@ -437,7 +437,7 @@ export var deserializeAws_restJson1GetSessionCommand = function (output, context
|
|
|
437
437
|
if (data.sessionId !== undefined && data.sessionId !== null) {
|
|
438
438
|
contents.sessionId = __expectString(data.sessionId);
|
|
439
439
|
}
|
|
440
|
-
return [2
|
|
440
|
+
return [2, Promise.resolve(contents)];
|
|
441
441
|
}
|
|
442
442
|
});
|
|
443
443
|
}); };
|
|
@@ -449,47 +449,47 @@ var deserializeAws_restJson1GetSessionCommandError = function (output, context)
|
|
|
449
449
|
case 0:
|
|
450
450
|
_a = [__assign({}, output)];
|
|
451
451
|
_g = {};
|
|
452
|
-
return [4
|
|
452
|
+
return [4, parseBody(output.body, context)];
|
|
453
453
|
case 1:
|
|
454
454
|
parsedOutput = __assign.apply(void 0, _a.concat([(_g.body = _h.sent(), _g)]));
|
|
455
455
|
errorCode = "UnknownError";
|
|
456
456
|
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
457
457
|
_b = errorCode;
|
|
458
458
|
switch (_b) {
|
|
459
|
-
case "BadRequestException": return [3
|
|
460
|
-
case "com.amazonaws.lexruntimeservice#BadRequestException": return [3
|
|
461
|
-
case "InternalFailureException": return [3
|
|
462
|
-
case "com.amazonaws.lexruntimeservice#InternalFailureException": return [3
|
|
463
|
-
case "LimitExceededException": return [3
|
|
464
|
-
case "com.amazonaws.lexruntimeservice#LimitExceededException": return [3
|
|
465
|
-
case "NotFoundException": return [3
|
|
466
|
-
case "com.amazonaws.lexruntimeservice#NotFoundException": return [3
|
|
459
|
+
case "BadRequestException": return [3, 2];
|
|
460
|
+
case "com.amazonaws.lexruntimeservice#BadRequestException": return [3, 2];
|
|
461
|
+
case "InternalFailureException": return [3, 4];
|
|
462
|
+
case "com.amazonaws.lexruntimeservice#InternalFailureException": return [3, 4];
|
|
463
|
+
case "LimitExceededException": return [3, 6];
|
|
464
|
+
case "com.amazonaws.lexruntimeservice#LimitExceededException": return [3, 6];
|
|
465
|
+
case "NotFoundException": return [3, 8];
|
|
466
|
+
case "com.amazonaws.lexruntimeservice#NotFoundException": return [3, 8];
|
|
467
467
|
}
|
|
468
|
-
return [3
|
|
468
|
+
return [3, 10];
|
|
469
469
|
case 2:
|
|
470
470
|
_c = [{}];
|
|
471
|
-
return [4
|
|
471
|
+
return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
|
|
472
472
|
case 3:
|
|
473
473
|
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
474
|
-
return [3
|
|
474
|
+
return [3, 11];
|
|
475
475
|
case 4:
|
|
476
476
|
_d = [{}];
|
|
477
|
-
return [4
|
|
477
|
+
return [4, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
|
|
478
478
|
case 5:
|
|
479
479
|
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
480
|
-
return [3
|
|
480
|
+
return [3, 11];
|
|
481
481
|
case 6:
|
|
482
482
|
_e = [{}];
|
|
483
|
-
return [4
|
|
483
|
+
return [4, deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)];
|
|
484
484
|
case 7:
|
|
485
485
|
response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
486
|
-
return [3
|
|
486
|
+
return [3, 11];
|
|
487
487
|
case 8:
|
|
488
488
|
_f = [{}];
|
|
489
|
-
return [4
|
|
489
|
+
return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
|
|
490
490
|
case 9:
|
|
491
491
|
response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
492
|
-
return [3
|
|
492
|
+
return [3, 11];
|
|
493
493
|
case 10:
|
|
494
494
|
parsedBody = parsedOutput.body;
|
|
495
495
|
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
@@ -499,7 +499,7 @@ var deserializeAws_restJson1GetSessionCommandError = function (output, context)
|
|
|
499
499
|
message = response.message || response.Message || errorCode;
|
|
500
500
|
response.message = message;
|
|
501
501
|
delete response.Message;
|
|
502
|
-
return [2
|
|
502
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
503
503
|
}
|
|
504
504
|
});
|
|
505
505
|
}); };
|
|
@@ -507,7 +507,7 @@ export var deserializeAws_restJson1PostContentCommand = function (output, contex
|
|
|
507
507
|
var contents, data;
|
|
508
508
|
return __generator(this, function (_a) {
|
|
509
509
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
510
|
-
return [2
|
|
510
|
+
return [2, deserializeAws_restJson1PostContentCommandError(output, context)];
|
|
511
511
|
}
|
|
512
512
|
contents = {
|
|
513
513
|
$metadata: deserializeMetadata(output),
|
|
@@ -537,16 +537,16 @@ export var deserializeAws_restJson1PostContentCommand = function (output, contex
|
|
|
537
537
|
contents.intentName = output.headers["x-amz-lex-intent-name"];
|
|
538
538
|
}
|
|
539
539
|
if (output.headers["x-amz-lex-nlu-intent-confidence"] !== undefined) {
|
|
540
|
-
contents.nluIntentConfidence = new __LazyJsonString(Buffer.from(output.headers["x-amz-lex-nlu-intent-confidence"]
|
|
540
|
+
contents.nluIntentConfidence = new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-nlu-intent-confidence"])).toString("utf8"));
|
|
541
541
|
}
|
|
542
542
|
if (output.headers["x-amz-lex-alternative-intents"] !== undefined) {
|
|
543
|
-
contents.alternativeIntents = new __LazyJsonString(Buffer.from(output.headers["x-amz-lex-alternative-intents"]
|
|
543
|
+
contents.alternativeIntents = new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-alternative-intents"])).toString("utf8"));
|
|
544
544
|
}
|
|
545
545
|
if (output.headers["x-amz-lex-slots"] !== undefined) {
|
|
546
|
-
contents.slots = new __LazyJsonString(Buffer.from(output.headers["x-amz-lex-slots"]
|
|
546
|
+
contents.slots = new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-slots"])).toString("utf8"));
|
|
547
547
|
}
|
|
548
548
|
if (output.headers["x-amz-lex-session-attributes"] !== undefined) {
|
|
549
|
-
contents.sessionAttributes = new __LazyJsonString(Buffer.from(output.headers["x-amz-lex-session-attributes"]
|
|
549
|
+
contents.sessionAttributes = new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-session-attributes"])).toString("utf8"));
|
|
550
550
|
}
|
|
551
551
|
if (output.headers["x-amz-lex-sentiment"] !== undefined) {
|
|
552
552
|
contents.sentimentResponse = output.headers["x-amz-lex-sentiment"];
|
|
@@ -579,11 +579,11 @@ export var deserializeAws_restJson1PostContentCommand = function (output, contex
|
|
|
579
579
|
contents.sessionId = output.headers["x-amz-lex-session-id"];
|
|
580
580
|
}
|
|
581
581
|
if (output.headers["x-amz-lex-active-contexts"] !== undefined) {
|
|
582
|
-
contents.activeContexts = new __LazyJsonString(Buffer.from(output.headers["x-amz-lex-active-contexts"]
|
|
582
|
+
contents.activeContexts = new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-active-contexts"])).toString("utf8"));
|
|
583
583
|
}
|
|
584
584
|
data = output.body;
|
|
585
585
|
contents.audioStream = data;
|
|
586
|
-
return [2
|
|
586
|
+
return [2, Promise.resolve(contents)];
|
|
587
587
|
});
|
|
588
588
|
}); };
|
|
589
589
|
var deserializeAws_restJson1PostContentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -594,103 +594,103 @@ var deserializeAws_restJson1PostContentCommandError = function (output, context)
|
|
|
594
594
|
case 0:
|
|
595
595
|
_a = [__assign({}, output)];
|
|
596
596
|
_p = {};
|
|
597
|
-
return [4
|
|
597
|
+
return [4, parseBody(output.body, context)];
|
|
598
598
|
case 1:
|
|
599
599
|
parsedOutput = __assign.apply(void 0, _a.concat([(_p.body = _q.sent(), _p)]));
|
|
600
600
|
errorCode = "UnknownError";
|
|
601
601
|
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
602
602
|
_b = errorCode;
|
|
603
603
|
switch (_b) {
|
|
604
|
-
case "BadGatewayException": return [3
|
|
605
|
-
case "com.amazonaws.lexruntimeservice#BadGatewayException": return [3
|
|
606
|
-
case "BadRequestException": return [3
|
|
607
|
-
case "com.amazonaws.lexruntimeservice#BadRequestException": return [3
|
|
608
|
-
case "ConflictException": return [3
|
|
609
|
-
case "com.amazonaws.lexruntimeservice#ConflictException": return [3
|
|
610
|
-
case "DependencyFailedException": return [3
|
|
611
|
-
case "com.amazonaws.lexruntimeservice#DependencyFailedException": return [3
|
|
612
|
-
case "InternalFailureException": return [3
|
|
613
|
-
case "com.amazonaws.lexruntimeservice#InternalFailureException": return [3
|
|
614
|
-
case "LimitExceededException": return [3
|
|
615
|
-
case "com.amazonaws.lexruntimeservice#LimitExceededException": return [3
|
|
616
|
-
case "LoopDetectedException": return [3
|
|
617
|
-
case "com.amazonaws.lexruntimeservice#LoopDetectedException": return [3
|
|
618
|
-
case "NotAcceptableException": return [3
|
|
619
|
-
case "com.amazonaws.lexruntimeservice#NotAcceptableException": return [3
|
|
620
|
-
case "NotFoundException": return [3
|
|
621
|
-
case "com.amazonaws.lexruntimeservice#NotFoundException": return [3
|
|
622
|
-
case "RequestTimeoutException": return [3
|
|
623
|
-
case "com.amazonaws.lexruntimeservice#RequestTimeoutException": return [3
|
|
624
|
-
case "UnsupportedMediaTypeException": return [3
|
|
625
|
-
case "com.amazonaws.lexruntimeservice#UnsupportedMediaTypeException": return [3
|
|
604
|
+
case "BadGatewayException": return [3, 2];
|
|
605
|
+
case "com.amazonaws.lexruntimeservice#BadGatewayException": return [3, 2];
|
|
606
|
+
case "BadRequestException": return [3, 4];
|
|
607
|
+
case "com.amazonaws.lexruntimeservice#BadRequestException": return [3, 4];
|
|
608
|
+
case "ConflictException": return [3, 6];
|
|
609
|
+
case "com.amazonaws.lexruntimeservice#ConflictException": return [3, 6];
|
|
610
|
+
case "DependencyFailedException": return [3, 8];
|
|
611
|
+
case "com.amazonaws.lexruntimeservice#DependencyFailedException": return [3, 8];
|
|
612
|
+
case "InternalFailureException": return [3, 10];
|
|
613
|
+
case "com.amazonaws.lexruntimeservice#InternalFailureException": return [3, 10];
|
|
614
|
+
case "LimitExceededException": return [3, 12];
|
|
615
|
+
case "com.amazonaws.lexruntimeservice#LimitExceededException": return [3, 12];
|
|
616
|
+
case "LoopDetectedException": return [3, 14];
|
|
617
|
+
case "com.amazonaws.lexruntimeservice#LoopDetectedException": return [3, 14];
|
|
618
|
+
case "NotAcceptableException": return [3, 16];
|
|
619
|
+
case "com.amazonaws.lexruntimeservice#NotAcceptableException": return [3, 16];
|
|
620
|
+
case "NotFoundException": return [3, 18];
|
|
621
|
+
case "com.amazonaws.lexruntimeservice#NotFoundException": return [3, 18];
|
|
622
|
+
case "RequestTimeoutException": return [3, 20];
|
|
623
|
+
case "com.amazonaws.lexruntimeservice#RequestTimeoutException": return [3, 20];
|
|
624
|
+
case "UnsupportedMediaTypeException": return [3, 22];
|
|
625
|
+
case "com.amazonaws.lexruntimeservice#UnsupportedMediaTypeException": return [3, 22];
|
|
626
626
|
}
|
|
627
|
-
return [3
|
|
627
|
+
return [3, 24];
|
|
628
628
|
case 2:
|
|
629
629
|
_c = [{}];
|
|
630
|
-
return [4
|
|
630
|
+
return [4, deserializeAws_restJson1BadGatewayExceptionResponse(parsedOutput, context)];
|
|
631
631
|
case 3:
|
|
632
632
|
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_q.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
633
|
-
return [3
|
|
633
|
+
return [3, 25];
|
|
634
634
|
case 4:
|
|
635
635
|
_d = [{}];
|
|
636
|
-
return [4
|
|
636
|
+
return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
|
|
637
637
|
case 5:
|
|
638
638
|
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_q.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
639
|
-
return [3
|
|
639
|
+
return [3, 25];
|
|
640
640
|
case 6:
|
|
641
641
|
_e = [{}];
|
|
642
|
-
return [4
|
|
642
|
+
return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
|
|
643
643
|
case 7:
|
|
644
644
|
response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_q.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
645
|
-
return [3
|
|
645
|
+
return [3, 25];
|
|
646
646
|
case 8:
|
|
647
647
|
_f = [{}];
|
|
648
|
-
return [4
|
|
648
|
+
return [4, deserializeAws_restJson1DependencyFailedExceptionResponse(parsedOutput, context)];
|
|
649
649
|
case 9:
|
|
650
650
|
response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_q.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
651
|
-
return [3
|
|
651
|
+
return [3, 25];
|
|
652
652
|
case 10:
|
|
653
653
|
_g = [{}];
|
|
654
|
-
return [4
|
|
654
|
+
return [4, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
|
|
655
655
|
case 11:
|
|
656
656
|
response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_q.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
657
|
-
return [3
|
|
657
|
+
return [3, 25];
|
|
658
658
|
case 12:
|
|
659
659
|
_h = [{}];
|
|
660
|
-
return [4
|
|
660
|
+
return [4, deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)];
|
|
661
661
|
case 13:
|
|
662
662
|
response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_q.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
663
|
-
return [3
|
|
663
|
+
return [3, 25];
|
|
664
664
|
case 14:
|
|
665
665
|
_j = [{}];
|
|
666
|
-
return [4
|
|
666
|
+
return [4, deserializeAws_restJson1LoopDetectedExceptionResponse(parsedOutput, context)];
|
|
667
667
|
case 15:
|
|
668
668
|
response = __assign.apply(void 0, [__assign.apply(void 0, _j.concat([(_q.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
669
|
-
return [3
|
|
669
|
+
return [3, 25];
|
|
670
670
|
case 16:
|
|
671
671
|
_k = [{}];
|
|
672
|
-
return [4
|
|
672
|
+
return [4, deserializeAws_restJson1NotAcceptableExceptionResponse(parsedOutput, context)];
|
|
673
673
|
case 17:
|
|
674
674
|
response = __assign.apply(void 0, [__assign.apply(void 0, _k.concat([(_q.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
675
|
-
return [3
|
|
675
|
+
return [3, 25];
|
|
676
676
|
case 18:
|
|
677
677
|
_l = [{}];
|
|
678
|
-
return [4
|
|
678
|
+
return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
|
|
679
679
|
case 19:
|
|
680
680
|
response = __assign.apply(void 0, [__assign.apply(void 0, _l.concat([(_q.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
681
|
-
return [3
|
|
681
|
+
return [3, 25];
|
|
682
682
|
case 20:
|
|
683
683
|
_m = [{}];
|
|
684
|
-
return [4
|
|
684
|
+
return [4, deserializeAws_restJson1RequestTimeoutExceptionResponse(parsedOutput, context)];
|
|
685
685
|
case 21:
|
|
686
686
|
response = __assign.apply(void 0, [__assign.apply(void 0, _m.concat([(_q.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
687
|
-
return [3
|
|
687
|
+
return [3, 25];
|
|
688
688
|
case 22:
|
|
689
689
|
_o = [{}];
|
|
690
|
-
return [4
|
|
690
|
+
return [4, deserializeAws_restJson1UnsupportedMediaTypeExceptionResponse(parsedOutput, context)];
|
|
691
691
|
case 23:
|
|
692
692
|
response = __assign.apply(void 0, [__assign.apply(void 0, _o.concat([(_q.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
693
|
-
return [3
|
|
693
|
+
return [3, 25];
|
|
694
694
|
case 24:
|
|
695
695
|
parsedBody = parsedOutput.body;
|
|
696
696
|
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
@@ -700,7 +700,7 @@ var deserializeAws_restJson1PostContentCommandError = function (output, context)
|
|
|
700
700
|
message = response.message || response.Message || errorCode;
|
|
701
701
|
response.message = message;
|
|
702
702
|
delete response.Message;
|
|
703
|
-
return [2
|
|
703
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
704
704
|
}
|
|
705
705
|
});
|
|
706
706
|
}); };
|
|
@@ -710,7 +710,7 @@ export var deserializeAws_restJson1PostTextCommand = function (output, context)
|
|
|
710
710
|
switch (_c.label) {
|
|
711
711
|
case 0:
|
|
712
712
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
713
|
-
return [2
|
|
713
|
+
return [2, deserializeAws_restJson1PostTextCommandError(output, context)];
|
|
714
714
|
}
|
|
715
715
|
contents = {
|
|
716
716
|
$metadata: deserializeMetadata(output),
|
|
@@ -731,7 +731,7 @@ export var deserializeAws_restJson1PostTextCommand = function (output, context)
|
|
|
731
731
|
};
|
|
732
732
|
_a = __expectNonNull;
|
|
733
733
|
_b = __expectObject;
|
|
734
|
-
return [4
|
|
734
|
+
return [4, parseBody(output.body, context)];
|
|
735
735
|
case 1:
|
|
736
736
|
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
737
737
|
if (data.activeContexts !== undefined && data.activeContexts !== null) {
|
|
@@ -776,7 +776,7 @@ export var deserializeAws_restJson1PostTextCommand = function (output, context)
|
|
|
776
776
|
if (data.slots !== undefined && data.slots !== null) {
|
|
777
777
|
contents.slots = deserializeAws_restJson1StringMap(data.slots, context);
|
|
778
778
|
}
|
|
779
|
-
return [2
|
|
779
|
+
return [2, Promise.resolve(contents)];
|
|
780
780
|
}
|
|
781
781
|
});
|
|
782
782
|
}); };
|
|
@@ -788,79 +788,79 @@ var deserializeAws_restJson1PostTextCommandError = function (output, context) {
|
|
|
788
788
|
case 0:
|
|
789
789
|
_a = [__assign({}, output)];
|
|
790
790
|
_l = {};
|
|
791
|
-
return [4
|
|
791
|
+
return [4, parseBody(output.body, context)];
|
|
792
792
|
case 1:
|
|
793
793
|
parsedOutput = __assign.apply(void 0, _a.concat([(_l.body = _m.sent(), _l)]));
|
|
794
794
|
errorCode = "UnknownError";
|
|
795
795
|
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
796
796
|
_b = errorCode;
|
|
797
797
|
switch (_b) {
|
|
798
|
-
case "BadGatewayException": return [3
|
|
799
|
-
case "com.amazonaws.lexruntimeservice#BadGatewayException": return [3
|
|
800
|
-
case "BadRequestException": return [3
|
|
801
|
-
case "com.amazonaws.lexruntimeservice#BadRequestException": return [3
|
|
802
|
-
case "ConflictException": return [3
|
|
803
|
-
case "com.amazonaws.lexruntimeservice#ConflictException": return [3
|
|
804
|
-
case "DependencyFailedException": return [3
|
|
805
|
-
case "com.amazonaws.lexruntimeservice#DependencyFailedException": return [3
|
|
806
|
-
case "InternalFailureException": return [3
|
|
807
|
-
case "com.amazonaws.lexruntimeservice#InternalFailureException": return [3
|
|
808
|
-
case "LimitExceededException": return [3
|
|
809
|
-
case "com.amazonaws.lexruntimeservice#LimitExceededException": return [3
|
|
810
|
-
case "LoopDetectedException": return [3
|
|
811
|
-
case "com.amazonaws.lexruntimeservice#LoopDetectedException": return [3
|
|
812
|
-
case "NotFoundException": return [3
|
|
813
|
-
case "com.amazonaws.lexruntimeservice#NotFoundException": return [3
|
|
798
|
+
case "BadGatewayException": return [3, 2];
|
|
799
|
+
case "com.amazonaws.lexruntimeservice#BadGatewayException": return [3, 2];
|
|
800
|
+
case "BadRequestException": return [3, 4];
|
|
801
|
+
case "com.amazonaws.lexruntimeservice#BadRequestException": return [3, 4];
|
|
802
|
+
case "ConflictException": return [3, 6];
|
|
803
|
+
case "com.amazonaws.lexruntimeservice#ConflictException": return [3, 6];
|
|
804
|
+
case "DependencyFailedException": return [3, 8];
|
|
805
|
+
case "com.amazonaws.lexruntimeservice#DependencyFailedException": return [3, 8];
|
|
806
|
+
case "InternalFailureException": return [3, 10];
|
|
807
|
+
case "com.amazonaws.lexruntimeservice#InternalFailureException": return [3, 10];
|
|
808
|
+
case "LimitExceededException": return [3, 12];
|
|
809
|
+
case "com.amazonaws.lexruntimeservice#LimitExceededException": return [3, 12];
|
|
810
|
+
case "LoopDetectedException": return [3, 14];
|
|
811
|
+
case "com.amazonaws.lexruntimeservice#LoopDetectedException": return [3, 14];
|
|
812
|
+
case "NotFoundException": return [3, 16];
|
|
813
|
+
case "com.amazonaws.lexruntimeservice#NotFoundException": return [3, 16];
|
|
814
814
|
}
|
|
815
|
-
return [3
|
|
815
|
+
return [3, 18];
|
|
816
816
|
case 2:
|
|
817
817
|
_c = [{}];
|
|
818
|
-
return [4
|
|
818
|
+
return [4, deserializeAws_restJson1BadGatewayExceptionResponse(parsedOutput, context)];
|
|
819
819
|
case 3:
|
|
820
820
|
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
821
|
-
return [3
|
|
821
|
+
return [3, 19];
|
|
822
822
|
case 4:
|
|
823
823
|
_d = [{}];
|
|
824
|
-
return [4
|
|
824
|
+
return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
|
|
825
825
|
case 5:
|
|
826
826
|
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
827
|
-
return [3
|
|
827
|
+
return [3, 19];
|
|
828
828
|
case 6:
|
|
829
829
|
_e = [{}];
|
|
830
|
-
return [4
|
|
830
|
+
return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
|
|
831
831
|
case 7:
|
|
832
832
|
response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
833
|
-
return [3
|
|
833
|
+
return [3, 19];
|
|
834
834
|
case 8:
|
|
835
835
|
_f = [{}];
|
|
836
|
-
return [4
|
|
836
|
+
return [4, deserializeAws_restJson1DependencyFailedExceptionResponse(parsedOutput, context)];
|
|
837
837
|
case 9:
|
|
838
838
|
response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
839
|
-
return [3
|
|
839
|
+
return [3, 19];
|
|
840
840
|
case 10:
|
|
841
841
|
_g = [{}];
|
|
842
|
-
return [4
|
|
842
|
+
return [4, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
|
|
843
843
|
case 11:
|
|
844
844
|
response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
845
|
-
return [3
|
|
845
|
+
return [3, 19];
|
|
846
846
|
case 12:
|
|
847
847
|
_h = [{}];
|
|
848
|
-
return [4
|
|
848
|
+
return [4, deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)];
|
|
849
849
|
case 13:
|
|
850
850
|
response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
851
|
-
return [3
|
|
851
|
+
return [3, 19];
|
|
852
852
|
case 14:
|
|
853
853
|
_j = [{}];
|
|
854
|
-
return [4
|
|
854
|
+
return [4, deserializeAws_restJson1LoopDetectedExceptionResponse(parsedOutput, context)];
|
|
855
855
|
case 15:
|
|
856
856
|
response = __assign.apply(void 0, [__assign.apply(void 0, _j.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
857
|
-
return [3
|
|
857
|
+
return [3, 19];
|
|
858
858
|
case 16:
|
|
859
859
|
_k = [{}];
|
|
860
|
-
return [4
|
|
860
|
+
return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
|
|
861
861
|
case 17:
|
|
862
862
|
response = __assign.apply(void 0, [__assign.apply(void 0, _k.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
863
|
-
return [3
|
|
863
|
+
return [3, 19];
|
|
864
864
|
case 18:
|
|
865
865
|
parsedBody = parsedOutput.body;
|
|
866
866
|
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
@@ -870,7 +870,7 @@ var deserializeAws_restJson1PostTextCommandError = function (output, context) {
|
|
|
870
870
|
message = response.message || response.Message || errorCode;
|
|
871
871
|
response.message = message;
|
|
872
872
|
delete response.Message;
|
|
873
|
-
return [2
|
|
873
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
874
874
|
}
|
|
875
875
|
});
|
|
876
876
|
}); };
|
|
@@ -878,7 +878,7 @@ export var deserializeAws_restJson1PutSessionCommand = function (output, context
|
|
|
878
878
|
var contents, data;
|
|
879
879
|
return __generator(this, function (_a) {
|
|
880
880
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
881
|
-
return [2
|
|
881
|
+
return [2, deserializeAws_restJson1PutSessionCommandError(output, context)];
|
|
882
882
|
}
|
|
883
883
|
contents = {
|
|
884
884
|
$metadata: deserializeMetadata(output),
|
|
@@ -902,10 +902,10 @@ export var deserializeAws_restJson1PutSessionCommand = function (output, context
|
|
|
902
902
|
contents.intentName = output.headers["x-amz-lex-intent-name"];
|
|
903
903
|
}
|
|
904
904
|
if (output.headers["x-amz-lex-slots"] !== undefined) {
|
|
905
|
-
contents.slots = new __LazyJsonString(Buffer.from(output.headers["x-amz-lex-slots"]
|
|
905
|
+
contents.slots = new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-slots"])).toString("utf8"));
|
|
906
906
|
}
|
|
907
907
|
if (output.headers["x-amz-lex-session-attributes"] !== undefined) {
|
|
908
|
-
contents.sessionAttributes = new __LazyJsonString(Buffer.from(output.headers["x-amz-lex-session-attributes"]
|
|
908
|
+
contents.sessionAttributes = new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-session-attributes"])).toString("utf8"));
|
|
909
909
|
}
|
|
910
910
|
if (output.headers["x-amz-lex-message"] !== undefined) {
|
|
911
911
|
contents.message = output.headers["x-amz-lex-message"];
|
|
@@ -926,11 +926,11 @@ export var deserializeAws_restJson1PutSessionCommand = function (output, context
|
|
|
926
926
|
contents.sessionId = output.headers["x-amz-lex-session-id"];
|
|
927
927
|
}
|
|
928
928
|
if (output.headers["x-amz-lex-active-contexts"] !== undefined) {
|
|
929
|
-
contents.activeContexts = new __LazyJsonString(Buffer.from(output.headers["x-amz-lex-active-contexts"]
|
|
929
|
+
contents.activeContexts = new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-active-contexts"])).toString("utf8"));
|
|
930
930
|
}
|
|
931
931
|
data = output.body;
|
|
932
932
|
contents.audioStream = data;
|
|
933
|
-
return [2
|
|
933
|
+
return [2, Promise.resolve(contents)];
|
|
934
934
|
});
|
|
935
935
|
}); };
|
|
936
936
|
var deserializeAws_restJson1PutSessionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -941,79 +941,79 @@ var deserializeAws_restJson1PutSessionCommandError = function (output, context)
|
|
|
941
941
|
case 0:
|
|
942
942
|
_a = [__assign({}, output)];
|
|
943
943
|
_l = {};
|
|
944
|
-
return [4
|
|
944
|
+
return [4, parseBody(output.body, context)];
|
|
945
945
|
case 1:
|
|
946
946
|
parsedOutput = __assign.apply(void 0, _a.concat([(_l.body = _m.sent(), _l)]));
|
|
947
947
|
errorCode = "UnknownError";
|
|
948
948
|
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
949
949
|
_b = errorCode;
|
|
950
950
|
switch (_b) {
|
|
951
|
-
case "BadGatewayException": return [3
|
|
952
|
-
case "com.amazonaws.lexruntimeservice#BadGatewayException": return [3
|
|
953
|
-
case "BadRequestException": return [3
|
|
954
|
-
case "com.amazonaws.lexruntimeservice#BadRequestException": return [3
|
|
955
|
-
case "ConflictException": return [3
|
|
956
|
-
case "com.amazonaws.lexruntimeservice#ConflictException": return [3
|
|
957
|
-
case "DependencyFailedException": return [3
|
|
958
|
-
case "com.amazonaws.lexruntimeservice#DependencyFailedException": return [3
|
|
959
|
-
case "InternalFailureException": return [3
|
|
960
|
-
case "com.amazonaws.lexruntimeservice#InternalFailureException": return [3
|
|
961
|
-
case "LimitExceededException": return [3
|
|
962
|
-
case "com.amazonaws.lexruntimeservice#LimitExceededException": return [3
|
|
963
|
-
case "NotAcceptableException": return [3
|
|
964
|
-
case "com.amazonaws.lexruntimeservice#NotAcceptableException": return [3
|
|
965
|
-
case "NotFoundException": return [3
|
|
966
|
-
case "com.amazonaws.lexruntimeservice#NotFoundException": return [3
|
|
951
|
+
case "BadGatewayException": return [3, 2];
|
|
952
|
+
case "com.amazonaws.lexruntimeservice#BadGatewayException": return [3, 2];
|
|
953
|
+
case "BadRequestException": return [3, 4];
|
|
954
|
+
case "com.amazonaws.lexruntimeservice#BadRequestException": return [3, 4];
|
|
955
|
+
case "ConflictException": return [3, 6];
|
|
956
|
+
case "com.amazonaws.lexruntimeservice#ConflictException": return [3, 6];
|
|
957
|
+
case "DependencyFailedException": return [3, 8];
|
|
958
|
+
case "com.amazonaws.lexruntimeservice#DependencyFailedException": return [3, 8];
|
|
959
|
+
case "InternalFailureException": return [3, 10];
|
|
960
|
+
case "com.amazonaws.lexruntimeservice#InternalFailureException": return [3, 10];
|
|
961
|
+
case "LimitExceededException": return [3, 12];
|
|
962
|
+
case "com.amazonaws.lexruntimeservice#LimitExceededException": return [3, 12];
|
|
963
|
+
case "NotAcceptableException": return [3, 14];
|
|
964
|
+
case "com.amazonaws.lexruntimeservice#NotAcceptableException": return [3, 14];
|
|
965
|
+
case "NotFoundException": return [3, 16];
|
|
966
|
+
case "com.amazonaws.lexruntimeservice#NotFoundException": return [3, 16];
|
|
967
967
|
}
|
|
968
|
-
return [3
|
|
968
|
+
return [3, 18];
|
|
969
969
|
case 2:
|
|
970
970
|
_c = [{}];
|
|
971
|
-
return [4
|
|
971
|
+
return [4, deserializeAws_restJson1BadGatewayExceptionResponse(parsedOutput, context)];
|
|
972
972
|
case 3:
|
|
973
973
|
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
974
|
-
return [3
|
|
974
|
+
return [3, 19];
|
|
975
975
|
case 4:
|
|
976
976
|
_d = [{}];
|
|
977
|
-
return [4
|
|
977
|
+
return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
|
|
978
978
|
case 5:
|
|
979
979
|
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
980
|
-
return [3
|
|
980
|
+
return [3, 19];
|
|
981
981
|
case 6:
|
|
982
982
|
_e = [{}];
|
|
983
|
-
return [4
|
|
983
|
+
return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
|
|
984
984
|
case 7:
|
|
985
985
|
response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
986
|
-
return [3
|
|
986
|
+
return [3, 19];
|
|
987
987
|
case 8:
|
|
988
988
|
_f = [{}];
|
|
989
|
-
return [4
|
|
989
|
+
return [4, deserializeAws_restJson1DependencyFailedExceptionResponse(parsedOutput, context)];
|
|
990
990
|
case 9:
|
|
991
991
|
response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
992
|
-
return [3
|
|
992
|
+
return [3, 19];
|
|
993
993
|
case 10:
|
|
994
994
|
_g = [{}];
|
|
995
|
-
return [4
|
|
995
|
+
return [4, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
|
|
996
996
|
case 11:
|
|
997
997
|
response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
998
|
-
return [3
|
|
998
|
+
return [3, 19];
|
|
999
999
|
case 12:
|
|
1000
1000
|
_h = [{}];
|
|
1001
|
-
return [4
|
|
1001
|
+
return [4, deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)];
|
|
1002
1002
|
case 13:
|
|
1003
1003
|
response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1004
|
-
return [3
|
|
1004
|
+
return [3, 19];
|
|
1005
1005
|
case 14:
|
|
1006
1006
|
_j = [{}];
|
|
1007
|
-
return [4
|
|
1007
|
+
return [4, deserializeAws_restJson1NotAcceptableExceptionResponse(parsedOutput, context)];
|
|
1008
1008
|
case 15:
|
|
1009
1009
|
response = __assign.apply(void 0, [__assign.apply(void 0, _j.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1010
|
-
return [3
|
|
1010
|
+
return [3, 19];
|
|
1011
1011
|
case 16:
|
|
1012
1012
|
_k = [{}];
|
|
1013
|
-
return [4
|
|
1013
|
+
return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
|
|
1014
1014
|
case 17:
|
|
1015
1015
|
response = __assign.apply(void 0, [__assign.apply(void 0, _k.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1016
|
-
return [3
|
|
1016
|
+
return [3, 19];
|
|
1017
1017
|
case 18:
|
|
1018
1018
|
parsedBody = parsedOutput.body;
|
|
1019
1019
|
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
@@ -1023,7 +1023,7 @@ var deserializeAws_restJson1PutSessionCommandError = function (output, context)
|
|
|
1023
1023
|
message = response.message || response.Message || errorCode;
|
|
1024
1024
|
response.message = message;
|
|
1025
1025
|
delete response.Message;
|
|
1026
|
-
return [2
|
|
1026
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
1027
1027
|
}
|
|
1028
1028
|
});
|
|
1029
1029
|
}); };
|
|
@@ -1040,7 +1040,7 @@ var deserializeAws_restJson1BadGatewayExceptionResponse = function (parsedOutput
|
|
|
1040
1040
|
if (data.Message !== undefined && data.Message !== null) {
|
|
1041
1041
|
contents.Message = __expectString(data.Message);
|
|
1042
1042
|
}
|
|
1043
|
-
return [2
|
|
1043
|
+
return [2, contents];
|
|
1044
1044
|
});
|
|
1045
1045
|
}); };
|
|
1046
1046
|
var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -1056,7 +1056,7 @@ var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput
|
|
|
1056
1056
|
if (data.message !== undefined && data.message !== null) {
|
|
1057
1057
|
contents.message = __expectString(data.message);
|
|
1058
1058
|
}
|
|
1059
|
-
return [2
|
|
1059
|
+
return [2, contents];
|
|
1060
1060
|
});
|
|
1061
1061
|
}); };
|
|
1062
1062
|
var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -1072,7 +1072,7 @@ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput,
|
|
|
1072
1072
|
if (data.message !== undefined && data.message !== null) {
|
|
1073
1073
|
contents.message = __expectString(data.message);
|
|
1074
1074
|
}
|
|
1075
|
-
return [2
|
|
1075
|
+
return [2, contents];
|
|
1076
1076
|
});
|
|
1077
1077
|
}); };
|
|
1078
1078
|
var deserializeAws_restJson1DependencyFailedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -1088,7 +1088,7 @@ var deserializeAws_restJson1DependencyFailedExceptionResponse = function (parsed
|
|
|
1088
1088
|
if (data.Message !== undefined && data.Message !== null) {
|
|
1089
1089
|
contents.Message = __expectString(data.Message);
|
|
1090
1090
|
}
|
|
1091
|
-
return [2
|
|
1091
|
+
return [2, contents];
|
|
1092
1092
|
});
|
|
1093
1093
|
}); };
|
|
1094
1094
|
var deserializeAws_restJson1InternalFailureExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -1104,7 +1104,7 @@ var deserializeAws_restJson1InternalFailureExceptionResponse = function (parsedO
|
|
|
1104
1104
|
if (data.message !== undefined && data.message !== null) {
|
|
1105
1105
|
contents.message = __expectString(data.message);
|
|
1106
1106
|
}
|
|
1107
|
-
return [2
|
|
1107
|
+
return [2, contents];
|
|
1108
1108
|
});
|
|
1109
1109
|
}); };
|
|
1110
1110
|
var deserializeAws_restJson1LimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -1124,7 +1124,7 @@ var deserializeAws_restJson1LimitExceededExceptionResponse = function (parsedOut
|
|
|
1124
1124
|
if (data.message !== undefined && data.message !== null) {
|
|
1125
1125
|
contents.message = __expectString(data.message);
|
|
1126
1126
|
}
|
|
1127
|
-
return [2
|
|
1127
|
+
return [2, contents];
|
|
1128
1128
|
});
|
|
1129
1129
|
}); };
|
|
1130
1130
|
var deserializeAws_restJson1LoopDetectedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -1140,7 +1140,7 @@ var deserializeAws_restJson1LoopDetectedExceptionResponse = function (parsedOutp
|
|
|
1140
1140
|
if (data.Message !== undefined && data.Message !== null) {
|
|
1141
1141
|
contents.Message = __expectString(data.Message);
|
|
1142
1142
|
}
|
|
1143
|
-
return [2
|
|
1143
|
+
return [2, contents];
|
|
1144
1144
|
});
|
|
1145
1145
|
}); };
|
|
1146
1146
|
var deserializeAws_restJson1NotAcceptableExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -1156,7 +1156,7 @@ var deserializeAws_restJson1NotAcceptableExceptionResponse = function (parsedOut
|
|
|
1156
1156
|
if (data.message !== undefined && data.message !== null) {
|
|
1157
1157
|
contents.message = __expectString(data.message);
|
|
1158
1158
|
}
|
|
1159
|
-
return [2
|
|
1159
|
+
return [2, contents];
|
|
1160
1160
|
});
|
|
1161
1161
|
}); };
|
|
1162
1162
|
var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -1172,7 +1172,7 @@ var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput,
|
|
|
1172
1172
|
if (data.message !== undefined && data.message !== null) {
|
|
1173
1173
|
contents.message = __expectString(data.message);
|
|
1174
1174
|
}
|
|
1175
|
-
return [2
|
|
1175
|
+
return [2, contents];
|
|
1176
1176
|
});
|
|
1177
1177
|
}); };
|
|
1178
1178
|
var deserializeAws_restJson1RequestTimeoutExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -1188,7 +1188,7 @@ var deserializeAws_restJson1RequestTimeoutExceptionResponse = function (parsedOu
|
|
|
1188
1188
|
if (data.message !== undefined && data.message !== null) {
|
|
1189
1189
|
contents.message = __expectString(data.message);
|
|
1190
1190
|
}
|
|
1191
|
-
return [2
|
|
1191
|
+
return [2, contents];
|
|
1192
1192
|
});
|
|
1193
1193
|
}); };
|
|
1194
1194
|
var deserializeAws_restJson1UnsupportedMediaTypeExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -1204,7 +1204,7 @@ var deserializeAws_restJson1UnsupportedMediaTypeExceptionResponse = function (pa
|
|
|
1204
1204
|
if (data.message !== undefined && data.message !== null) {
|
|
1205
1205
|
contents.message = __expectString(data.message);
|
|
1206
1206
|
}
|
|
1207
|
-
return [2
|
|
1207
|
+
return [2, contents];
|
|
1208
1208
|
});
|
|
1209
1209
|
}); };
|
|
1210
1210
|
var serializeAws_restJson1ActiveContext = function (input, context) {
|
|
@@ -1443,7 +1443,6 @@ var deserializeMetadata = function (output) {
|
|
|
1443
1443
|
cfId: output.headers["x-amz-cf-id"],
|
|
1444
1444
|
});
|
|
1445
1445
|
};
|
|
1446
|
-
// Collect low-level response body stream to Uint8Array.
|
|
1447
1446
|
var collectBody = function (streamBody, context) {
|
|
1448
1447
|
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
1449
1448
|
if (streamBody instanceof Uint8Array) {
|
|
@@ -1451,7 +1450,6 @@ var collectBody = function (streamBody, context) {
|
|
|
1451
1450
|
}
|
|
1452
1451
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
1453
1452
|
};
|
|
1454
|
-
// Encode Uint8Array data into string with utf-8.
|
|
1455
1453
|
var collectBodyString = function (streamBody, context) {
|
|
1456
1454
|
return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
|
|
1457
1455
|
};
|
|
@@ -1470,9 +1468,6 @@ var parseBody = function (streamBody, context) {
|
|
|
1470
1468
|
return {};
|
|
1471
1469
|
});
|
|
1472
1470
|
};
|
|
1473
|
-
/**
|
|
1474
|
-
* Load an error code for the aws.rest-json-1.1 protocol.
|
|
1475
|
-
*/
|
|
1476
1471
|
var loadRestJsonErrorCode = function (output, data) {
|
|
1477
1472
|
var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
|
|
1478
1473
|
var sanitizeErrorCode = function (rawValue) {
|