@aws-sdk/client-polly 3.181.0 → 3.183.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 +8 -0
- package/dist-es/Polly.js +38 -45
- package/dist-es/PollyClient.js +22 -28
- package/dist-es/commands/DeleteLexiconCommand.js +21 -28
- package/dist-es/commands/DescribeVoicesCommand.js +21 -28
- package/dist-es/commands/GetLexiconCommand.js +21 -28
- package/dist-es/commands/GetSpeechSynthesisTaskCommand.js +21 -28
- package/dist-es/commands/ListLexiconsCommand.js +21 -28
- package/dist-es/commands/ListSpeechSynthesisTasksCommand.js +21 -28
- package/dist-es/commands/PutLexiconCommand.js +21 -28
- package/dist-es/commands/StartSpeechSynthesisTaskCommand.js +21 -28
- package/dist-es/commands/SynthesizeSpeechCommand.js +21 -28
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/PollyServiceException.js +5 -10
- package/dist-es/models/models_0.js +303 -255
- package/dist-es/pagination/ListSpeechSynthesisTasksPaginator.js +25 -68
- package/dist-es/protocols/Aws_restJson1.js +878 -1154
- package/dist-es/runtimeConfig.browser.js +26 -12
- package/dist-es/runtimeConfig.js +30 -12
- package/dist-es/runtimeConfig.native.js +8 -5
- package/dist-es/runtimeConfig.shared.js +8 -11
- package/package.json +33 -33
|
@@ -1,1139 +1,881 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
1
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
2
|
import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, strictParseInt32 as __strictParseInt32, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
4
3
|
import { EngineNotSupportedException, InvalidLexiconException, InvalidNextTokenException, InvalidS3BucketException, InvalidS3KeyException, InvalidSampleRateException, InvalidSnsTopicArnException, InvalidSsmlException, InvalidTaskIdException, LanguageNotSupportedException, LexiconNotFoundException, LexiconSizeExceededException, MarksNotSupportedForFormatException, MaxLexemeLengthExceededException, MaxLexiconsNumberExceededException, ServiceFailureException, SsmlMarksNotSupportedForTextTypeException, SynthesisTaskNotFoundException, TextLengthExceededException, UnsupportedPlsAlphabetException, UnsupportedPlsLanguageException, } from "../models/models_0";
|
|
5
4
|
import { PollyServiceException as __BaseException } from "../models/PollyServiceException";
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
method: "DELETE",
|
|
21
|
-
headers: headers,
|
|
22
|
-
path: resolvedPath,
|
|
23
|
-
body: body,
|
|
24
|
-
})];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}); };
|
|
28
|
-
export var serializeAws_restJson1DescribeVoicesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
29
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
|
|
30
|
-
return __generator(this, function (_c) {
|
|
31
|
-
switch (_c.label) {
|
|
32
|
-
case 0: return [4, context.endpoint()];
|
|
33
|
-
case 1:
|
|
34
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
35
|
-
headers = {};
|
|
36
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/voices";
|
|
37
|
-
query = map({
|
|
38
|
-
Engine: [, input.Engine],
|
|
39
|
-
LanguageCode: [, input.LanguageCode],
|
|
40
|
-
IncludeAdditionalLanguageCodes: [
|
|
41
|
-
function () { return input.IncludeAdditionalLanguageCodes !== void 0; },
|
|
42
|
-
function () { return input.IncludeAdditionalLanguageCodes.toString(); },
|
|
43
|
-
],
|
|
44
|
-
NextToken: [, input.NextToken],
|
|
45
|
-
});
|
|
46
|
-
return [2, new __HttpRequest({
|
|
47
|
-
protocol: protocol,
|
|
48
|
-
hostname: hostname,
|
|
49
|
-
port: port,
|
|
50
|
-
method: "GET",
|
|
51
|
-
headers: headers,
|
|
52
|
-
path: resolvedPath,
|
|
53
|
-
query: query,
|
|
54
|
-
body: body,
|
|
55
|
-
})];
|
|
56
|
-
}
|
|
5
|
+
export const serializeAws_restJson1DeleteLexiconCommand = async (input, context) => {
|
|
6
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
7
|
+
const headers = {};
|
|
8
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/lexicons/{Name}";
|
|
9
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
|
|
10
|
+
let body;
|
|
11
|
+
return new __HttpRequest({
|
|
12
|
+
protocol,
|
|
13
|
+
hostname,
|
|
14
|
+
port,
|
|
15
|
+
method: "DELETE",
|
|
16
|
+
headers,
|
|
17
|
+
path: resolvedPath,
|
|
18
|
+
body,
|
|
57
19
|
});
|
|
58
|
-
}
|
|
59
|
-
export
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
hostname: hostname,
|
|
72
|
-
port: port,
|
|
73
|
-
method: "GET",
|
|
74
|
-
headers: headers,
|
|
75
|
-
path: resolvedPath,
|
|
76
|
-
body: body,
|
|
77
|
-
})];
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
}); };
|
|
81
|
-
export var serializeAws_restJson1GetSpeechSynthesisTaskCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
82
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
83
|
-
return __generator(this, function (_c) {
|
|
84
|
-
switch (_c.label) {
|
|
85
|
-
case 0: return [4, context.endpoint()];
|
|
86
|
-
case 1:
|
|
87
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
88
|
-
headers = {};
|
|
89
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/synthesisTasks/{TaskId}";
|
|
90
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "TaskId", function () { return input.TaskId; }, "{TaskId}", false);
|
|
91
|
-
return [2, new __HttpRequest({
|
|
92
|
-
protocol: protocol,
|
|
93
|
-
hostname: hostname,
|
|
94
|
-
port: port,
|
|
95
|
-
method: "GET",
|
|
96
|
-
headers: headers,
|
|
97
|
-
path: resolvedPath,
|
|
98
|
-
body: body,
|
|
99
|
-
})];
|
|
100
|
-
}
|
|
20
|
+
};
|
|
21
|
+
export const serializeAws_restJson1DescribeVoicesCommand = async (input, context) => {
|
|
22
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
23
|
+
const headers = {};
|
|
24
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/voices";
|
|
25
|
+
const query = map({
|
|
26
|
+
Engine: [, input.Engine],
|
|
27
|
+
LanguageCode: [, input.LanguageCode],
|
|
28
|
+
IncludeAdditionalLanguageCodes: [
|
|
29
|
+
() => input.IncludeAdditionalLanguageCodes !== void 0,
|
|
30
|
+
() => input.IncludeAdditionalLanguageCodes.toString(),
|
|
31
|
+
],
|
|
32
|
+
NextToken: [, input.NextToken],
|
|
101
33
|
});
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
query = map({
|
|
113
|
-
NextToken: [, input.NextToken],
|
|
114
|
-
});
|
|
115
|
-
return [2, new __HttpRequest({
|
|
116
|
-
protocol: protocol,
|
|
117
|
-
hostname: hostname,
|
|
118
|
-
port: port,
|
|
119
|
-
method: "GET",
|
|
120
|
-
headers: headers,
|
|
121
|
-
path: resolvedPath,
|
|
122
|
-
query: query,
|
|
123
|
-
body: body,
|
|
124
|
-
})];
|
|
125
|
-
}
|
|
34
|
+
let body;
|
|
35
|
+
return new __HttpRequest({
|
|
36
|
+
protocol,
|
|
37
|
+
hostname,
|
|
38
|
+
port,
|
|
39
|
+
method: "GET",
|
|
40
|
+
headers,
|
|
41
|
+
path: resolvedPath,
|
|
42
|
+
query,
|
|
43
|
+
body,
|
|
126
44
|
});
|
|
127
|
-
}
|
|
128
|
-
export
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
return [2, new __HttpRequest({
|
|
143
|
-
protocol: protocol,
|
|
144
|
-
hostname: hostname,
|
|
145
|
-
port: port,
|
|
146
|
-
method: "GET",
|
|
147
|
-
headers: headers,
|
|
148
|
-
path: resolvedPath,
|
|
149
|
-
query: query,
|
|
150
|
-
body: body,
|
|
151
|
-
})];
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
}); };
|
|
155
|
-
export var serializeAws_restJson1PutLexiconCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
156
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
157
|
-
return __generator(this, function (_c) {
|
|
158
|
-
switch (_c.label) {
|
|
159
|
-
case 0: return [4, context.endpoint()];
|
|
160
|
-
case 1:
|
|
161
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
162
|
-
headers = {
|
|
163
|
-
"content-type": "application/json",
|
|
164
|
-
};
|
|
165
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/lexicons/{Name}";
|
|
166
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "Name", function () { return input.Name; }, "{Name}", false);
|
|
167
|
-
body = JSON.stringify(__assign({}, (input.Content != null && { Content: input.Content })));
|
|
168
|
-
return [2, new __HttpRequest({
|
|
169
|
-
protocol: protocol,
|
|
170
|
-
hostname: hostname,
|
|
171
|
-
port: port,
|
|
172
|
-
method: "PUT",
|
|
173
|
-
headers: headers,
|
|
174
|
-
path: resolvedPath,
|
|
175
|
-
body: body,
|
|
176
|
-
})];
|
|
177
|
-
}
|
|
45
|
+
};
|
|
46
|
+
export const serializeAws_restJson1GetLexiconCommand = async (input, context) => {
|
|
47
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
48
|
+
const headers = {};
|
|
49
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/lexicons/{Name}";
|
|
50
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
|
|
51
|
+
let body;
|
|
52
|
+
return new __HttpRequest({
|
|
53
|
+
protocol,
|
|
54
|
+
hostname,
|
|
55
|
+
port,
|
|
56
|
+
method: "GET",
|
|
57
|
+
headers,
|
|
58
|
+
path: resolvedPath,
|
|
59
|
+
body,
|
|
178
60
|
});
|
|
179
|
-
}
|
|
180
|
-
export
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
SpeechMarkTypes: serializeAws_restJson1SpeechMarkTypeList(input.SpeechMarkTypes, context),
|
|
195
|
-
})), (input.Text != null && { Text: input.Text })), (input.TextType != null && { TextType: input.TextType })), (input.VoiceId != null && { VoiceId: input.VoiceId })));
|
|
196
|
-
return [2, new __HttpRequest({
|
|
197
|
-
protocol: protocol,
|
|
198
|
-
hostname: hostname,
|
|
199
|
-
port: port,
|
|
200
|
-
method: "POST",
|
|
201
|
-
headers: headers,
|
|
202
|
-
path: resolvedPath,
|
|
203
|
-
body: body,
|
|
204
|
-
})];
|
|
205
|
-
}
|
|
61
|
+
};
|
|
62
|
+
export const serializeAws_restJson1GetSpeechSynthesisTaskCommand = async (input, context) => {
|
|
63
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
64
|
+
const headers = {};
|
|
65
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/synthesisTasks/{TaskId}";
|
|
66
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "TaskId", () => input.TaskId, "{TaskId}", false);
|
|
67
|
+
let body;
|
|
68
|
+
return new __HttpRequest({
|
|
69
|
+
protocol,
|
|
70
|
+
hostname,
|
|
71
|
+
port,
|
|
72
|
+
method: "GET",
|
|
73
|
+
headers,
|
|
74
|
+
path: resolvedPath,
|
|
75
|
+
body,
|
|
206
76
|
});
|
|
207
|
-
}
|
|
208
|
-
export
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
215
|
-
headers = {
|
|
216
|
-
"content-type": "application/json",
|
|
217
|
-
};
|
|
218
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/speech";
|
|
219
|
-
body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.Engine != null && { Engine: input.Engine })), (input.LanguageCode != null && { LanguageCode: input.LanguageCode })), (input.LexiconNames != null && {
|
|
220
|
-
LexiconNames: serializeAws_restJson1LexiconNameList(input.LexiconNames, context),
|
|
221
|
-
})), (input.OutputFormat != null && { OutputFormat: input.OutputFormat })), (input.SampleRate != null && { SampleRate: input.SampleRate })), (input.SpeechMarkTypes != null && {
|
|
222
|
-
SpeechMarkTypes: serializeAws_restJson1SpeechMarkTypeList(input.SpeechMarkTypes, context),
|
|
223
|
-
})), (input.Text != null && { Text: input.Text })), (input.TextType != null && { TextType: input.TextType })), (input.VoiceId != null && { VoiceId: input.VoiceId })));
|
|
224
|
-
return [2, new __HttpRequest({
|
|
225
|
-
protocol: protocol,
|
|
226
|
-
hostname: hostname,
|
|
227
|
-
port: port,
|
|
228
|
-
method: "POST",
|
|
229
|
-
headers: headers,
|
|
230
|
-
path: resolvedPath,
|
|
231
|
-
body: body,
|
|
232
|
-
})];
|
|
233
|
-
}
|
|
77
|
+
};
|
|
78
|
+
export const serializeAws_restJson1ListLexiconsCommand = async (input, context) => {
|
|
79
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
80
|
+
const headers = {};
|
|
81
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/lexicons";
|
|
82
|
+
const query = map({
|
|
83
|
+
NextToken: [, input.NextToken],
|
|
234
84
|
});
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
$metadata: deserializeMetadata(output),
|
|
246
|
-
});
|
|
247
|
-
return [4, collectBody(output.body, context)];
|
|
248
|
-
case 1:
|
|
249
|
-
_a.sent();
|
|
250
|
-
return [2, contents];
|
|
251
|
-
}
|
|
85
|
+
let body;
|
|
86
|
+
return new __HttpRequest({
|
|
87
|
+
protocol,
|
|
88
|
+
hostname,
|
|
89
|
+
port,
|
|
90
|
+
method: "GET",
|
|
91
|
+
headers,
|
|
92
|
+
path: resolvedPath,
|
|
93
|
+
query,
|
|
94
|
+
body,
|
|
252
95
|
});
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
return [4, parseErrorBody(output.body, context)];
|
|
263
|
-
case 1:
|
|
264
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
265
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
266
|
-
_b = errorCode;
|
|
267
|
-
switch (_b) {
|
|
268
|
-
case "LexiconNotFoundException": return [3, 2];
|
|
269
|
-
case "com.amazonaws.polly#LexiconNotFoundException": return [3, 2];
|
|
270
|
-
case "ServiceFailureException": return [3, 4];
|
|
271
|
-
case "com.amazonaws.polly#ServiceFailureException": return [3, 4];
|
|
272
|
-
}
|
|
273
|
-
return [3, 6];
|
|
274
|
-
case 2: return [4, deserializeAws_restJson1LexiconNotFoundExceptionResponse(parsedOutput, context)];
|
|
275
|
-
case 3: throw _d.sent();
|
|
276
|
-
case 4: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
|
|
277
|
-
case 5: throw _d.sent();
|
|
278
|
-
case 6:
|
|
279
|
-
parsedBody = parsedOutput.body;
|
|
280
|
-
throwDefaultError({
|
|
281
|
-
output: output,
|
|
282
|
-
parsedBody: parsedBody,
|
|
283
|
-
exceptionCtor: __BaseException,
|
|
284
|
-
errorCode: errorCode,
|
|
285
|
-
});
|
|
286
|
-
_d.label = 7;
|
|
287
|
-
case 7: return [2];
|
|
288
|
-
}
|
|
96
|
+
};
|
|
97
|
+
export const serializeAws_restJson1ListSpeechSynthesisTasksCommand = async (input, context) => {
|
|
98
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
99
|
+
const headers = {};
|
|
100
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/synthesisTasks";
|
|
101
|
+
const query = map({
|
|
102
|
+
MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
|
|
103
|
+
NextToken: [, input.NextToken],
|
|
104
|
+
Status: [, input.Status],
|
|
289
105
|
});
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
$metadata: deserializeMetadata(output),
|
|
301
|
-
});
|
|
302
|
-
_a = __expectNonNull;
|
|
303
|
-
_b = __expectObject;
|
|
304
|
-
return [4, parseBody(output.body, context)];
|
|
305
|
-
case 1:
|
|
306
|
-
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
307
|
-
if (data.NextToken != null) {
|
|
308
|
-
contents.NextToken = __expectString(data.NextToken);
|
|
309
|
-
}
|
|
310
|
-
if (data.Voices != null) {
|
|
311
|
-
contents.Voices = deserializeAws_restJson1VoiceList(data.Voices, context);
|
|
312
|
-
}
|
|
313
|
-
return [2, contents];
|
|
314
|
-
}
|
|
106
|
+
let body;
|
|
107
|
+
return new __HttpRequest({
|
|
108
|
+
protocol,
|
|
109
|
+
hostname,
|
|
110
|
+
port,
|
|
111
|
+
method: "GET",
|
|
112
|
+
headers,
|
|
113
|
+
path: resolvedPath,
|
|
114
|
+
query,
|
|
115
|
+
body,
|
|
315
116
|
});
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
328
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
329
|
-
_b = errorCode;
|
|
330
|
-
switch (_b) {
|
|
331
|
-
case "InvalidNextTokenException": return [3, 2];
|
|
332
|
-
case "com.amazonaws.polly#InvalidNextTokenException": return [3, 2];
|
|
333
|
-
case "ServiceFailureException": return [3, 4];
|
|
334
|
-
case "com.amazonaws.polly#ServiceFailureException": return [3, 4];
|
|
335
|
-
}
|
|
336
|
-
return [3, 6];
|
|
337
|
-
case 2: return [4, deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context)];
|
|
338
|
-
case 3: throw _d.sent();
|
|
339
|
-
case 4: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
|
|
340
|
-
case 5: throw _d.sent();
|
|
341
|
-
case 6:
|
|
342
|
-
parsedBody = parsedOutput.body;
|
|
343
|
-
throwDefaultError({
|
|
344
|
-
output: output,
|
|
345
|
-
parsedBody: parsedBody,
|
|
346
|
-
exceptionCtor: __BaseException,
|
|
347
|
-
errorCode: errorCode,
|
|
348
|
-
});
|
|
349
|
-
_d.label = 7;
|
|
350
|
-
case 7: return [2];
|
|
351
|
-
}
|
|
117
|
+
};
|
|
118
|
+
export const serializeAws_restJson1PutLexiconCommand = async (input, context) => {
|
|
119
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
120
|
+
const headers = {
|
|
121
|
+
"content-type": "application/json",
|
|
122
|
+
};
|
|
123
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/lexicons/{Name}";
|
|
124
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
|
|
125
|
+
let body;
|
|
126
|
+
body = JSON.stringify({
|
|
127
|
+
...(input.Content != null && { Content: input.Content }),
|
|
352
128
|
});
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
}
|
|
362
|
-
contents = map({
|
|
363
|
-
$metadata: deserializeMetadata(output),
|
|
364
|
-
});
|
|
365
|
-
_a = __expectNonNull;
|
|
366
|
-
_b = __expectObject;
|
|
367
|
-
return [4, parseBody(output.body, context)];
|
|
368
|
-
case 1:
|
|
369
|
-
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
370
|
-
if (data.Lexicon != null) {
|
|
371
|
-
contents.Lexicon = deserializeAws_restJson1Lexicon(data.Lexicon, context);
|
|
372
|
-
}
|
|
373
|
-
if (data.LexiconAttributes != null) {
|
|
374
|
-
contents.LexiconAttributes = deserializeAws_restJson1LexiconAttributes(data.LexiconAttributes, context);
|
|
375
|
-
}
|
|
376
|
-
return [2, contents];
|
|
377
|
-
}
|
|
129
|
+
return new __HttpRequest({
|
|
130
|
+
protocol,
|
|
131
|
+
hostname,
|
|
132
|
+
port,
|
|
133
|
+
method: "PUT",
|
|
134
|
+
headers,
|
|
135
|
+
path: resolvedPath,
|
|
136
|
+
body,
|
|
378
137
|
});
|
|
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
|
-
case 6:
|
|
405
|
-
parsedBody = parsedOutput.body;
|
|
406
|
-
throwDefaultError({
|
|
407
|
-
output: output,
|
|
408
|
-
parsedBody: parsedBody,
|
|
409
|
-
exceptionCtor: __BaseException,
|
|
410
|
-
errorCode: errorCode,
|
|
411
|
-
});
|
|
412
|
-
_d.label = 7;
|
|
413
|
-
case 7: return [2];
|
|
414
|
-
}
|
|
138
|
+
};
|
|
139
|
+
export const serializeAws_restJson1StartSpeechSynthesisTaskCommand = async (input, context) => {
|
|
140
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
141
|
+
const headers = {
|
|
142
|
+
"content-type": "application/json",
|
|
143
|
+
};
|
|
144
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/synthesisTasks";
|
|
145
|
+
let body;
|
|
146
|
+
body = JSON.stringify({
|
|
147
|
+
...(input.Engine != null && { Engine: input.Engine }),
|
|
148
|
+
...(input.LanguageCode != null && { LanguageCode: input.LanguageCode }),
|
|
149
|
+
...(input.LexiconNames != null && {
|
|
150
|
+
LexiconNames: serializeAws_restJson1LexiconNameList(input.LexiconNames, context),
|
|
151
|
+
}),
|
|
152
|
+
...(input.OutputFormat != null && { OutputFormat: input.OutputFormat }),
|
|
153
|
+
...(input.OutputS3BucketName != null && { OutputS3BucketName: input.OutputS3BucketName }),
|
|
154
|
+
...(input.OutputS3KeyPrefix != null && { OutputS3KeyPrefix: input.OutputS3KeyPrefix }),
|
|
155
|
+
...(input.SampleRate != null && { SampleRate: input.SampleRate }),
|
|
156
|
+
...(input.SnsTopicArn != null && { SnsTopicArn: input.SnsTopicArn }),
|
|
157
|
+
...(input.SpeechMarkTypes != null && {
|
|
158
|
+
SpeechMarkTypes: serializeAws_restJson1SpeechMarkTypeList(input.SpeechMarkTypes, context),
|
|
159
|
+
}),
|
|
160
|
+
...(input.Text != null && { Text: input.Text }),
|
|
161
|
+
...(input.TextType != null && { TextType: input.TextType }),
|
|
162
|
+
...(input.VoiceId != null && { VoiceId: input.VoiceId }),
|
|
415
163
|
});
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
}
|
|
425
|
-
contents = map({
|
|
426
|
-
$metadata: deserializeMetadata(output),
|
|
427
|
-
});
|
|
428
|
-
_a = __expectNonNull;
|
|
429
|
-
_b = __expectObject;
|
|
430
|
-
return [4, parseBody(output.body, context)];
|
|
431
|
-
case 1:
|
|
432
|
-
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
433
|
-
if (data.SynthesisTask != null) {
|
|
434
|
-
contents.SynthesisTask = deserializeAws_restJson1SynthesisTask(data.SynthesisTask, context);
|
|
435
|
-
}
|
|
436
|
-
return [2, contents];
|
|
437
|
-
}
|
|
164
|
+
return new __HttpRequest({
|
|
165
|
+
protocol,
|
|
166
|
+
hostname,
|
|
167
|
+
port,
|
|
168
|
+
method: "POST",
|
|
169
|
+
headers,
|
|
170
|
+
path: resolvedPath,
|
|
171
|
+
body,
|
|
438
172
|
});
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
return [3, 8];
|
|
462
|
-
case 2: return [4, deserializeAws_restJson1InvalidTaskIdExceptionResponse(parsedOutput, context)];
|
|
463
|
-
case 3: throw _d.sent();
|
|
464
|
-
case 4: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
|
|
465
|
-
case 5: throw _d.sent();
|
|
466
|
-
case 6: return [4, deserializeAws_restJson1SynthesisTaskNotFoundExceptionResponse(parsedOutput, context)];
|
|
467
|
-
case 7: throw _d.sent();
|
|
468
|
-
case 8:
|
|
469
|
-
parsedBody = parsedOutput.body;
|
|
470
|
-
throwDefaultError({
|
|
471
|
-
output: output,
|
|
472
|
-
parsedBody: parsedBody,
|
|
473
|
-
exceptionCtor: __BaseException,
|
|
474
|
-
errorCode: errorCode,
|
|
475
|
-
});
|
|
476
|
-
_d.label = 9;
|
|
477
|
-
case 9: return [2];
|
|
478
|
-
}
|
|
173
|
+
};
|
|
174
|
+
export const serializeAws_restJson1SynthesizeSpeechCommand = async (input, context) => {
|
|
175
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
176
|
+
const headers = {
|
|
177
|
+
"content-type": "application/json",
|
|
178
|
+
};
|
|
179
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/speech";
|
|
180
|
+
let body;
|
|
181
|
+
body = JSON.stringify({
|
|
182
|
+
...(input.Engine != null && { Engine: input.Engine }),
|
|
183
|
+
...(input.LanguageCode != null && { LanguageCode: input.LanguageCode }),
|
|
184
|
+
...(input.LexiconNames != null && {
|
|
185
|
+
LexiconNames: serializeAws_restJson1LexiconNameList(input.LexiconNames, context),
|
|
186
|
+
}),
|
|
187
|
+
...(input.OutputFormat != null && { OutputFormat: input.OutputFormat }),
|
|
188
|
+
...(input.SampleRate != null && { SampleRate: input.SampleRate }),
|
|
189
|
+
...(input.SpeechMarkTypes != null && {
|
|
190
|
+
SpeechMarkTypes: serializeAws_restJson1SpeechMarkTypeList(input.SpeechMarkTypes, context),
|
|
191
|
+
}),
|
|
192
|
+
...(input.Text != null && { Text: input.Text }),
|
|
193
|
+
...(input.TextType != null && { TextType: input.TextType }),
|
|
194
|
+
...(input.VoiceId != null && { VoiceId: input.VoiceId }),
|
|
479
195
|
});
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
}
|
|
489
|
-
contents = map({
|
|
490
|
-
$metadata: deserializeMetadata(output),
|
|
491
|
-
});
|
|
492
|
-
_a = __expectNonNull;
|
|
493
|
-
_b = __expectObject;
|
|
494
|
-
return [4, parseBody(output.body, context)];
|
|
495
|
-
case 1:
|
|
496
|
-
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
497
|
-
if (data.Lexicons != null) {
|
|
498
|
-
contents.Lexicons = deserializeAws_restJson1LexiconDescriptionList(data.Lexicons, context);
|
|
499
|
-
}
|
|
500
|
-
if (data.NextToken != null) {
|
|
501
|
-
contents.NextToken = __expectString(data.NextToken);
|
|
502
|
-
}
|
|
503
|
-
return [2, contents];
|
|
504
|
-
}
|
|
196
|
+
return new __HttpRequest({
|
|
197
|
+
protocol,
|
|
198
|
+
hostname,
|
|
199
|
+
port,
|
|
200
|
+
method: "POST",
|
|
201
|
+
headers,
|
|
202
|
+
path: resolvedPath,
|
|
203
|
+
body,
|
|
505
204
|
});
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
_a = [__assign({}, output)];
|
|
514
|
-
_c = {};
|
|
515
|
-
return [4, parseErrorBody(output.body, context)];
|
|
516
|
-
case 1:
|
|
517
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
518
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
519
|
-
_b = errorCode;
|
|
520
|
-
switch (_b) {
|
|
521
|
-
case "InvalidNextTokenException": return [3, 2];
|
|
522
|
-
case "com.amazonaws.polly#InvalidNextTokenException": return [3, 2];
|
|
523
|
-
case "ServiceFailureException": return [3, 4];
|
|
524
|
-
case "com.amazonaws.polly#ServiceFailureException": return [3, 4];
|
|
525
|
-
}
|
|
526
|
-
return [3, 6];
|
|
527
|
-
case 2: return [4, deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context)];
|
|
528
|
-
case 3: throw _d.sent();
|
|
529
|
-
case 4: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
|
|
530
|
-
case 5: throw _d.sent();
|
|
531
|
-
case 6:
|
|
532
|
-
parsedBody = parsedOutput.body;
|
|
533
|
-
throwDefaultError({
|
|
534
|
-
output: output,
|
|
535
|
-
parsedBody: parsedBody,
|
|
536
|
-
exceptionCtor: __BaseException,
|
|
537
|
-
errorCode: errorCode,
|
|
538
|
-
});
|
|
539
|
-
_d.label = 7;
|
|
540
|
-
case 7: return [2];
|
|
541
|
-
}
|
|
205
|
+
};
|
|
206
|
+
export const deserializeAws_restJson1DeleteLexiconCommand = async (output, context) => {
|
|
207
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
208
|
+
return deserializeAws_restJson1DeleteLexiconCommandError(output, context);
|
|
209
|
+
}
|
|
210
|
+
const contents = map({
|
|
211
|
+
$metadata: deserializeMetadata(output),
|
|
542
212
|
});
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
213
|
+
await collectBody(output.body, context);
|
|
214
|
+
return contents;
|
|
215
|
+
};
|
|
216
|
+
const deserializeAws_restJson1DeleteLexiconCommandError = async (output, context) => {
|
|
217
|
+
const parsedOutput = {
|
|
218
|
+
...output,
|
|
219
|
+
body: await parseErrorBody(output.body, context),
|
|
220
|
+
};
|
|
221
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
222
|
+
switch (errorCode) {
|
|
223
|
+
case "LexiconNotFoundException":
|
|
224
|
+
case "com.amazonaws.polly#LexiconNotFoundException":
|
|
225
|
+
throw await deserializeAws_restJson1LexiconNotFoundExceptionResponse(parsedOutput, context);
|
|
226
|
+
case "ServiceFailureException":
|
|
227
|
+
case "com.amazonaws.polly#ServiceFailureException":
|
|
228
|
+
throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
|
|
229
|
+
default:
|
|
230
|
+
const parsedBody = parsedOutput.body;
|
|
231
|
+
throwDefaultError({
|
|
232
|
+
output,
|
|
233
|
+
parsedBody,
|
|
234
|
+
exceptionCtor: __BaseException,
|
|
235
|
+
errorCode,
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
export const deserializeAws_restJson1DescribeVoicesCommand = async (output, context) => {
|
|
240
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
241
|
+
return deserializeAws_restJson1DescribeVoicesCommandError(output, context);
|
|
242
|
+
}
|
|
243
|
+
const contents = map({
|
|
244
|
+
$metadata: deserializeMetadata(output),
|
|
568
245
|
});
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
parsedBody
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
246
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
247
|
+
if (data.NextToken != null) {
|
|
248
|
+
contents.NextToken = __expectString(data.NextToken);
|
|
249
|
+
}
|
|
250
|
+
if (data.Voices != null) {
|
|
251
|
+
contents.Voices = deserializeAws_restJson1VoiceList(data.Voices, context);
|
|
252
|
+
}
|
|
253
|
+
return contents;
|
|
254
|
+
};
|
|
255
|
+
const deserializeAws_restJson1DescribeVoicesCommandError = async (output, context) => {
|
|
256
|
+
const parsedOutput = {
|
|
257
|
+
...output,
|
|
258
|
+
body: await parseErrorBody(output.body, context),
|
|
259
|
+
};
|
|
260
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
261
|
+
switch (errorCode) {
|
|
262
|
+
case "InvalidNextTokenException":
|
|
263
|
+
case "com.amazonaws.polly#InvalidNextTokenException":
|
|
264
|
+
throw await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context);
|
|
265
|
+
case "ServiceFailureException":
|
|
266
|
+
case "com.amazonaws.polly#ServiceFailureException":
|
|
267
|
+
throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
|
|
268
|
+
default:
|
|
269
|
+
const parsedBody = parsedOutput.body;
|
|
270
|
+
throwDefaultError({
|
|
271
|
+
output,
|
|
272
|
+
parsedBody,
|
|
273
|
+
exceptionCtor: __BaseException,
|
|
274
|
+
errorCode,
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
export const deserializeAws_restJson1GetLexiconCommand = async (output, context) => {
|
|
279
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
280
|
+
return deserializeAws_restJson1GetLexiconCommandError(output, context);
|
|
281
|
+
}
|
|
282
|
+
const contents = map({
|
|
283
|
+
$metadata: deserializeMetadata(output),
|
|
605
284
|
});
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
285
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
286
|
+
if (data.Lexicon != null) {
|
|
287
|
+
contents.Lexicon = deserializeAws_restJson1Lexicon(data.Lexicon, context);
|
|
288
|
+
}
|
|
289
|
+
if (data.LexiconAttributes != null) {
|
|
290
|
+
contents.LexiconAttributes = deserializeAws_restJson1LexiconAttributes(data.LexiconAttributes, context);
|
|
291
|
+
}
|
|
292
|
+
return contents;
|
|
293
|
+
};
|
|
294
|
+
const deserializeAws_restJson1GetLexiconCommandError = async (output, context) => {
|
|
295
|
+
const parsedOutput = {
|
|
296
|
+
...output,
|
|
297
|
+
body: await parseErrorBody(output.body, context),
|
|
298
|
+
};
|
|
299
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
300
|
+
switch (errorCode) {
|
|
301
|
+
case "LexiconNotFoundException":
|
|
302
|
+
case "com.amazonaws.polly#LexiconNotFoundException":
|
|
303
|
+
throw await deserializeAws_restJson1LexiconNotFoundExceptionResponse(parsedOutput, context);
|
|
304
|
+
case "ServiceFailureException":
|
|
305
|
+
case "com.amazonaws.polly#ServiceFailureException":
|
|
306
|
+
throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
|
|
307
|
+
default:
|
|
308
|
+
const parsedBody = parsedOutput.body;
|
|
309
|
+
throwDefaultError({
|
|
310
|
+
output,
|
|
311
|
+
parsedBody,
|
|
312
|
+
exceptionCtor: __BaseException,
|
|
313
|
+
errorCode,
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
export const deserializeAws_restJson1GetSpeechSynthesisTaskCommand = async (output, context) => {
|
|
318
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
319
|
+
return deserializeAws_restJson1GetSpeechSynthesisTaskCommandError(output, context);
|
|
320
|
+
}
|
|
321
|
+
const contents = map({
|
|
322
|
+
$metadata: deserializeMetadata(output),
|
|
623
323
|
});
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
return
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
case 9: throw _d.sent();
|
|
663
|
-
case 10: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
|
|
664
|
-
case 11: throw _d.sent();
|
|
665
|
-
case 12: return [4, deserializeAws_restJson1UnsupportedPlsAlphabetExceptionResponse(parsedOutput, context)];
|
|
666
|
-
case 13: throw _d.sent();
|
|
667
|
-
case 14: return [4, deserializeAws_restJson1UnsupportedPlsLanguageExceptionResponse(parsedOutput, context)];
|
|
668
|
-
case 15: throw _d.sent();
|
|
669
|
-
case 16:
|
|
670
|
-
parsedBody = parsedOutput.body;
|
|
671
|
-
throwDefaultError({
|
|
672
|
-
output: output,
|
|
673
|
-
parsedBody: parsedBody,
|
|
674
|
-
exceptionCtor: __BaseException,
|
|
675
|
-
errorCode: errorCode,
|
|
676
|
-
});
|
|
677
|
-
_d.label = 17;
|
|
678
|
-
case 17: return [2];
|
|
679
|
-
}
|
|
324
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
325
|
+
if (data.SynthesisTask != null) {
|
|
326
|
+
contents.SynthesisTask = deserializeAws_restJson1SynthesisTask(data.SynthesisTask, context);
|
|
327
|
+
}
|
|
328
|
+
return contents;
|
|
329
|
+
};
|
|
330
|
+
const deserializeAws_restJson1GetSpeechSynthesisTaskCommandError = async (output, context) => {
|
|
331
|
+
const parsedOutput = {
|
|
332
|
+
...output,
|
|
333
|
+
body: await parseErrorBody(output.body, context),
|
|
334
|
+
};
|
|
335
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
336
|
+
switch (errorCode) {
|
|
337
|
+
case "InvalidTaskIdException":
|
|
338
|
+
case "com.amazonaws.polly#InvalidTaskIdException":
|
|
339
|
+
throw await deserializeAws_restJson1InvalidTaskIdExceptionResponse(parsedOutput, context);
|
|
340
|
+
case "ServiceFailureException":
|
|
341
|
+
case "com.amazonaws.polly#ServiceFailureException":
|
|
342
|
+
throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
|
|
343
|
+
case "SynthesisTaskNotFoundException":
|
|
344
|
+
case "com.amazonaws.polly#SynthesisTaskNotFoundException":
|
|
345
|
+
throw await deserializeAws_restJson1SynthesisTaskNotFoundExceptionResponse(parsedOutput, context);
|
|
346
|
+
default:
|
|
347
|
+
const parsedBody = parsedOutput.body;
|
|
348
|
+
throwDefaultError({
|
|
349
|
+
output,
|
|
350
|
+
parsedBody,
|
|
351
|
+
exceptionCtor: __BaseException,
|
|
352
|
+
errorCode,
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
export const deserializeAws_restJson1ListLexiconsCommand = async (output, context) => {
|
|
357
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
358
|
+
return deserializeAws_restJson1ListLexiconsCommandError(output, context);
|
|
359
|
+
}
|
|
360
|
+
const contents = map({
|
|
361
|
+
$metadata: deserializeMetadata(output),
|
|
680
362
|
});
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
363
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
364
|
+
if (data.Lexicons != null) {
|
|
365
|
+
contents.Lexicons = deserializeAws_restJson1LexiconDescriptionList(data.Lexicons, context);
|
|
366
|
+
}
|
|
367
|
+
if (data.NextToken != null) {
|
|
368
|
+
contents.NextToken = __expectString(data.NextToken);
|
|
369
|
+
}
|
|
370
|
+
return contents;
|
|
371
|
+
};
|
|
372
|
+
const deserializeAws_restJson1ListLexiconsCommandError = async (output, context) => {
|
|
373
|
+
const parsedOutput = {
|
|
374
|
+
...output,
|
|
375
|
+
body: await parseErrorBody(output.body, context),
|
|
376
|
+
};
|
|
377
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
378
|
+
switch (errorCode) {
|
|
379
|
+
case "InvalidNextTokenException":
|
|
380
|
+
case "com.amazonaws.polly#InvalidNextTokenException":
|
|
381
|
+
throw await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context);
|
|
382
|
+
case "ServiceFailureException":
|
|
383
|
+
case "com.amazonaws.polly#ServiceFailureException":
|
|
384
|
+
throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
|
|
385
|
+
default:
|
|
386
|
+
const parsedBody = parsedOutput.body;
|
|
387
|
+
throwDefaultError({
|
|
388
|
+
output,
|
|
389
|
+
parsedBody,
|
|
390
|
+
exceptionCtor: __BaseException,
|
|
391
|
+
errorCode,
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
export const deserializeAws_restJson1ListSpeechSynthesisTasksCommand = async (output, context) => {
|
|
396
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
397
|
+
return deserializeAws_restJson1ListSpeechSynthesisTasksCommandError(output, context);
|
|
398
|
+
}
|
|
399
|
+
const contents = map({
|
|
400
|
+
$metadata: deserializeMetadata(output),
|
|
703
401
|
});
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
case "com.amazonaws.polly#TextLengthExceededException": return [3, 24];
|
|
743
|
-
}
|
|
744
|
-
return [3, 26];
|
|
745
|
-
case 2: return [4, deserializeAws_restJson1EngineNotSupportedExceptionResponse(parsedOutput, context)];
|
|
746
|
-
case 3: throw _d.sent();
|
|
747
|
-
case 4: return [4, deserializeAws_restJson1InvalidS3BucketExceptionResponse(parsedOutput, context)];
|
|
748
|
-
case 5: throw _d.sent();
|
|
749
|
-
case 6: return [4, deserializeAws_restJson1InvalidS3KeyExceptionResponse(parsedOutput, context)];
|
|
750
|
-
case 7: throw _d.sent();
|
|
751
|
-
case 8: return [4, deserializeAws_restJson1InvalidSampleRateExceptionResponse(parsedOutput, context)];
|
|
752
|
-
case 9: throw _d.sent();
|
|
753
|
-
case 10: return [4, deserializeAws_restJson1InvalidSnsTopicArnExceptionResponse(parsedOutput, context)];
|
|
754
|
-
case 11: throw _d.sent();
|
|
755
|
-
case 12: return [4, deserializeAws_restJson1InvalidSsmlExceptionResponse(parsedOutput, context)];
|
|
756
|
-
case 13: throw _d.sent();
|
|
757
|
-
case 14: return [4, deserializeAws_restJson1LanguageNotSupportedExceptionResponse(parsedOutput, context)];
|
|
758
|
-
case 15: throw _d.sent();
|
|
759
|
-
case 16: return [4, deserializeAws_restJson1LexiconNotFoundExceptionResponse(parsedOutput, context)];
|
|
760
|
-
case 17: throw _d.sent();
|
|
761
|
-
case 18: return [4, deserializeAws_restJson1MarksNotSupportedForFormatExceptionResponse(parsedOutput, context)];
|
|
762
|
-
case 19: throw _d.sent();
|
|
763
|
-
case 20: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
|
|
764
|
-
case 21: throw _d.sent();
|
|
765
|
-
case 22: return [4, deserializeAws_restJson1SsmlMarksNotSupportedForTextTypeExceptionResponse(parsedOutput, context)];
|
|
766
|
-
case 23: throw _d.sent();
|
|
767
|
-
case 24: return [4, deserializeAws_restJson1TextLengthExceededExceptionResponse(parsedOutput, context)];
|
|
768
|
-
case 25: throw _d.sent();
|
|
769
|
-
case 26:
|
|
770
|
-
parsedBody = parsedOutput.body;
|
|
771
|
-
throwDefaultError({
|
|
772
|
-
output: output,
|
|
773
|
-
parsedBody: parsedBody,
|
|
774
|
-
exceptionCtor: __BaseException,
|
|
775
|
-
errorCode: errorCode,
|
|
776
|
-
});
|
|
777
|
-
_d.label = 27;
|
|
778
|
-
case 27: return [2];
|
|
779
|
-
}
|
|
402
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
403
|
+
if (data.NextToken != null) {
|
|
404
|
+
contents.NextToken = __expectString(data.NextToken);
|
|
405
|
+
}
|
|
406
|
+
if (data.SynthesisTasks != null) {
|
|
407
|
+
contents.SynthesisTasks = deserializeAws_restJson1SynthesisTasks(data.SynthesisTasks, context);
|
|
408
|
+
}
|
|
409
|
+
return contents;
|
|
410
|
+
};
|
|
411
|
+
const deserializeAws_restJson1ListSpeechSynthesisTasksCommandError = async (output, context) => {
|
|
412
|
+
const parsedOutput = {
|
|
413
|
+
...output,
|
|
414
|
+
body: await parseErrorBody(output.body, context),
|
|
415
|
+
};
|
|
416
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
417
|
+
switch (errorCode) {
|
|
418
|
+
case "InvalidNextTokenException":
|
|
419
|
+
case "com.amazonaws.polly#InvalidNextTokenException":
|
|
420
|
+
throw await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context);
|
|
421
|
+
case "ServiceFailureException":
|
|
422
|
+
case "com.amazonaws.polly#ServiceFailureException":
|
|
423
|
+
throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
|
|
424
|
+
default:
|
|
425
|
+
const parsedBody = parsedOutput.body;
|
|
426
|
+
throwDefaultError({
|
|
427
|
+
output,
|
|
428
|
+
parsedBody,
|
|
429
|
+
exceptionCtor: __BaseException,
|
|
430
|
+
errorCode,
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
};
|
|
434
|
+
export const deserializeAws_restJson1PutLexiconCommand = async (output, context) => {
|
|
435
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
436
|
+
return deserializeAws_restJson1PutLexiconCommandError(output, context);
|
|
437
|
+
}
|
|
438
|
+
const contents = map({
|
|
439
|
+
$metadata: deserializeMetadata(output),
|
|
780
440
|
});
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
441
|
+
await collectBody(output.body, context);
|
|
442
|
+
return contents;
|
|
443
|
+
};
|
|
444
|
+
const deserializeAws_restJson1PutLexiconCommandError = async (output, context) => {
|
|
445
|
+
const parsedOutput = {
|
|
446
|
+
...output,
|
|
447
|
+
body: await parseErrorBody(output.body, context),
|
|
448
|
+
};
|
|
449
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
450
|
+
switch (errorCode) {
|
|
451
|
+
case "InvalidLexiconException":
|
|
452
|
+
case "com.amazonaws.polly#InvalidLexiconException":
|
|
453
|
+
throw await deserializeAws_restJson1InvalidLexiconExceptionResponse(parsedOutput, context);
|
|
454
|
+
case "LexiconSizeExceededException":
|
|
455
|
+
case "com.amazonaws.polly#LexiconSizeExceededException":
|
|
456
|
+
throw await deserializeAws_restJson1LexiconSizeExceededExceptionResponse(parsedOutput, context);
|
|
457
|
+
case "MaxLexemeLengthExceededException":
|
|
458
|
+
case "com.amazonaws.polly#MaxLexemeLengthExceededException":
|
|
459
|
+
throw await deserializeAws_restJson1MaxLexemeLengthExceededExceptionResponse(parsedOutput, context);
|
|
460
|
+
case "MaxLexiconsNumberExceededException":
|
|
461
|
+
case "com.amazonaws.polly#MaxLexiconsNumberExceededException":
|
|
462
|
+
throw await deserializeAws_restJson1MaxLexiconsNumberExceededExceptionResponse(parsedOutput, context);
|
|
463
|
+
case "ServiceFailureException":
|
|
464
|
+
case "com.amazonaws.polly#ServiceFailureException":
|
|
465
|
+
throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
|
|
466
|
+
case "UnsupportedPlsAlphabetException":
|
|
467
|
+
case "com.amazonaws.polly#UnsupportedPlsAlphabetException":
|
|
468
|
+
throw await deserializeAws_restJson1UnsupportedPlsAlphabetExceptionResponse(parsedOutput, context);
|
|
469
|
+
case "UnsupportedPlsLanguageException":
|
|
470
|
+
case "com.amazonaws.polly#UnsupportedPlsLanguageException":
|
|
471
|
+
throw await deserializeAws_restJson1UnsupportedPlsLanguageExceptionResponse(parsedOutput, context);
|
|
472
|
+
default:
|
|
473
|
+
const parsedBody = parsedOutput.body;
|
|
474
|
+
throwDefaultError({
|
|
475
|
+
output,
|
|
476
|
+
parsedBody,
|
|
477
|
+
exceptionCtor: __BaseException,
|
|
478
|
+
errorCode,
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
};
|
|
482
|
+
export const deserializeAws_restJson1StartSpeechSynthesisTaskCommand = async (output, context) => {
|
|
483
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
484
|
+
return deserializeAws_restJson1StartSpeechSynthesisTaskCommandError(output, context);
|
|
485
|
+
}
|
|
486
|
+
const contents = map({
|
|
487
|
+
$metadata: deserializeMetadata(output),
|
|
799
488
|
});
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
return
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
489
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
490
|
+
if (data.SynthesisTask != null) {
|
|
491
|
+
contents.SynthesisTask = deserializeAws_restJson1SynthesisTask(data.SynthesisTask, context);
|
|
492
|
+
}
|
|
493
|
+
return contents;
|
|
494
|
+
};
|
|
495
|
+
const deserializeAws_restJson1StartSpeechSynthesisTaskCommandError = async (output, context) => {
|
|
496
|
+
const parsedOutput = {
|
|
497
|
+
...output,
|
|
498
|
+
body: await parseErrorBody(output.body, context),
|
|
499
|
+
};
|
|
500
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
501
|
+
switch (errorCode) {
|
|
502
|
+
case "EngineNotSupportedException":
|
|
503
|
+
case "com.amazonaws.polly#EngineNotSupportedException":
|
|
504
|
+
throw await deserializeAws_restJson1EngineNotSupportedExceptionResponse(parsedOutput, context);
|
|
505
|
+
case "InvalidS3BucketException":
|
|
506
|
+
case "com.amazonaws.polly#InvalidS3BucketException":
|
|
507
|
+
throw await deserializeAws_restJson1InvalidS3BucketExceptionResponse(parsedOutput, context);
|
|
508
|
+
case "InvalidS3KeyException":
|
|
509
|
+
case "com.amazonaws.polly#InvalidS3KeyException":
|
|
510
|
+
throw await deserializeAws_restJson1InvalidS3KeyExceptionResponse(parsedOutput, context);
|
|
511
|
+
case "InvalidSampleRateException":
|
|
512
|
+
case "com.amazonaws.polly#InvalidSampleRateException":
|
|
513
|
+
throw await deserializeAws_restJson1InvalidSampleRateExceptionResponse(parsedOutput, context);
|
|
514
|
+
case "InvalidSnsTopicArnException":
|
|
515
|
+
case "com.amazonaws.polly#InvalidSnsTopicArnException":
|
|
516
|
+
throw await deserializeAws_restJson1InvalidSnsTopicArnExceptionResponse(parsedOutput, context);
|
|
517
|
+
case "InvalidSsmlException":
|
|
518
|
+
case "com.amazonaws.polly#InvalidSsmlException":
|
|
519
|
+
throw await deserializeAws_restJson1InvalidSsmlExceptionResponse(parsedOutput, context);
|
|
520
|
+
case "LanguageNotSupportedException":
|
|
521
|
+
case "com.amazonaws.polly#LanguageNotSupportedException":
|
|
522
|
+
throw await deserializeAws_restJson1LanguageNotSupportedExceptionResponse(parsedOutput, context);
|
|
523
|
+
case "LexiconNotFoundException":
|
|
524
|
+
case "com.amazonaws.polly#LexiconNotFoundException":
|
|
525
|
+
throw await deserializeAws_restJson1LexiconNotFoundExceptionResponse(parsedOutput, context);
|
|
526
|
+
case "MarksNotSupportedForFormatException":
|
|
527
|
+
case "com.amazonaws.polly#MarksNotSupportedForFormatException":
|
|
528
|
+
throw await deserializeAws_restJson1MarksNotSupportedForFormatExceptionResponse(parsedOutput, context);
|
|
529
|
+
case "ServiceFailureException":
|
|
530
|
+
case "com.amazonaws.polly#ServiceFailureException":
|
|
531
|
+
throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
|
|
532
|
+
case "SsmlMarksNotSupportedForTextTypeException":
|
|
533
|
+
case "com.amazonaws.polly#SsmlMarksNotSupportedForTextTypeException":
|
|
534
|
+
throw await deserializeAws_restJson1SsmlMarksNotSupportedForTextTypeExceptionResponse(parsedOutput, context);
|
|
535
|
+
case "TextLengthExceededException":
|
|
536
|
+
case "com.amazonaws.polly#TextLengthExceededException":
|
|
537
|
+
throw await deserializeAws_restJson1TextLengthExceededExceptionResponse(parsedOutput, context);
|
|
538
|
+
default:
|
|
539
|
+
const parsedBody = parsedOutput.body;
|
|
540
|
+
throwDefaultError({
|
|
541
|
+
output,
|
|
542
|
+
parsedBody,
|
|
543
|
+
exceptionCtor: __BaseException,
|
|
544
|
+
errorCode,
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
};
|
|
548
|
+
export const deserializeAws_restJson1SynthesizeSpeechCommand = async (output, context) => {
|
|
549
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
550
|
+
return deserializeAws_restJson1SynthesizeSpeechCommandError(output, context);
|
|
551
|
+
}
|
|
552
|
+
const contents = map({
|
|
553
|
+
$metadata: deserializeMetadata(output),
|
|
554
|
+
ContentType: [, output.headers["content-type"]],
|
|
555
|
+
RequestCharacters: [
|
|
556
|
+
() => void 0 !== output.headers["x-amzn-requestcharacters"],
|
|
557
|
+
() => __strictParseInt32(output.headers["x-amzn-requestcharacters"]),
|
|
558
|
+
],
|
|
864
559
|
});
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
560
|
+
const data = output.body;
|
|
561
|
+
contents.AudioStream = data;
|
|
562
|
+
return contents;
|
|
563
|
+
};
|
|
564
|
+
const deserializeAws_restJson1SynthesizeSpeechCommandError = async (output, context) => {
|
|
565
|
+
const parsedOutput = {
|
|
566
|
+
...output,
|
|
567
|
+
body: await parseErrorBody(output.body, context),
|
|
568
|
+
};
|
|
569
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
570
|
+
switch (errorCode) {
|
|
571
|
+
case "EngineNotSupportedException":
|
|
572
|
+
case "com.amazonaws.polly#EngineNotSupportedException":
|
|
573
|
+
throw await deserializeAws_restJson1EngineNotSupportedExceptionResponse(parsedOutput, context);
|
|
574
|
+
case "InvalidSampleRateException":
|
|
575
|
+
case "com.amazonaws.polly#InvalidSampleRateException":
|
|
576
|
+
throw await deserializeAws_restJson1InvalidSampleRateExceptionResponse(parsedOutput, context);
|
|
577
|
+
case "InvalidSsmlException":
|
|
578
|
+
case "com.amazonaws.polly#InvalidSsmlException":
|
|
579
|
+
throw await deserializeAws_restJson1InvalidSsmlExceptionResponse(parsedOutput, context);
|
|
580
|
+
case "LanguageNotSupportedException":
|
|
581
|
+
case "com.amazonaws.polly#LanguageNotSupportedException":
|
|
582
|
+
throw await deserializeAws_restJson1LanguageNotSupportedExceptionResponse(parsedOutput, context);
|
|
583
|
+
case "LexiconNotFoundException":
|
|
584
|
+
case "com.amazonaws.polly#LexiconNotFoundException":
|
|
585
|
+
throw await deserializeAws_restJson1LexiconNotFoundExceptionResponse(parsedOutput, context);
|
|
586
|
+
case "MarksNotSupportedForFormatException":
|
|
587
|
+
case "com.amazonaws.polly#MarksNotSupportedForFormatException":
|
|
588
|
+
throw await deserializeAws_restJson1MarksNotSupportedForFormatExceptionResponse(parsedOutput, context);
|
|
589
|
+
case "ServiceFailureException":
|
|
590
|
+
case "com.amazonaws.polly#ServiceFailureException":
|
|
591
|
+
throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
|
|
592
|
+
case "SsmlMarksNotSupportedForTextTypeException":
|
|
593
|
+
case "com.amazonaws.polly#SsmlMarksNotSupportedForTextTypeException":
|
|
594
|
+
throw await deserializeAws_restJson1SsmlMarksNotSupportedForTextTypeExceptionResponse(parsedOutput, context);
|
|
595
|
+
case "TextLengthExceededException":
|
|
596
|
+
case "com.amazonaws.polly#TextLengthExceededException":
|
|
597
|
+
throw await deserializeAws_restJson1TextLengthExceededExceptionResponse(parsedOutput, context);
|
|
598
|
+
default:
|
|
599
|
+
const parsedBody = parsedOutput.body;
|
|
600
|
+
throwDefaultError({
|
|
601
|
+
output,
|
|
602
|
+
parsedBody,
|
|
603
|
+
exceptionCtor: __BaseException,
|
|
604
|
+
errorCode,
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
};
|
|
608
|
+
const map = __map;
|
|
609
|
+
const deserializeAws_restJson1EngineNotSupportedExceptionResponse = async (parsedOutput, context) => {
|
|
610
|
+
const contents = map({});
|
|
611
|
+
const data = parsedOutput.body;
|
|
612
|
+
if (data.message != null) {
|
|
613
|
+
contents.message = __expectString(data.message);
|
|
614
|
+
}
|
|
615
|
+
const exception = new EngineNotSupportedException({
|
|
616
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
617
|
+
...contents,
|
|
877
618
|
});
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
619
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
620
|
+
};
|
|
621
|
+
const deserializeAws_restJson1InvalidLexiconExceptionResponse = async (parsedOutput, context) => {
|
|
622
|
+
const contents = map({});
|
|
623
|
+
const data = parsedOutput.body;
|
|
624
|
+
if (data.message != null) {
|
|
625
|
+
contents.message = __expectString(data.message);
|
|
626
|
+
}
|
|
627
|
+
const exception = new InvalidLexiconException({
|
|
628
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
629
|
+
...contents,
|
|
889
630
|
});
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
631
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
632
|
+
};
|
|
633
|
+
const deserializeAws_restJson1InvalidNextTokenExceptionResponse = async (parsedOutput, context) => {
|
|
634
|
+
const contents = map({});
|
|
635
|
+
const data = parsedOutput.body;
|
|
636
|
+
if (data.message != null) {
|
|
637
|
+
contents.message = __expectString(data.message);
|
|
638
|
+
}
|
|
639
|
+
const exception = new InvalidNextTokenException({
|
|
640
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
641
|
+
...contents,
|
|
901
642
|
});
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
643
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
644
|
+
};
|
|
645
|
+
const deserializeAws_restJson1InvalidS3BucketExceptionResponse = async (parsedOutput, context) => {
|
|
646
|
+
const contents = map({});
|
|
647
|
+
const data = parsedOutput.body;
|
|
648
|
+
if (data.message != null) {
|
|
649
|
+
contents.message = __expectString(data.message);
|
|
650
|
+
}
|
|
651
|
+
const exception = new InvalidS3BucketException({
|
|
652
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
653
|
+
...contents,
|
|
913
654
|
});
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
655
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
656
|
+
};
|
|
657
|
+
const deserializeAws_restJson1InvalidS3KeyExceptionResponse = async (parsedOutput, context) => {
|
|
658
|
+
const contents = map({});
|
|
659
|
+
const data = parsedOutput.body;
|
|
660
|
+
if (data.message != null) {
|
|
661
|
+
contents.message = __expectString(data.message);
|
|
662
|
+
}
|
|
663
|
+
const exception = new InvalidS3KeyException({
|
|
664
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
665
|
+
...contents,
|
|
925
666
|
});
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
667
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
668
|
+
};
|
|
669
|
+
const deserializeAws_restJson1InvalidSampleRateExceptionResponse = async (parsedOutput, context) => {
|
|
670
|
+
const contents = map({});
|
|
671
|
+
const data = parsedOutput.body;
|
|
672
|
+
if (data.message != null) {
|
|
673
|
+
contents.message = __expectString(data.message);
|
|
674
|
+
}
|
|
675
|
+
const exception = new InvalidSampleRateException({
|
|
676
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
677
|
+
...contents,
|
|
937
678
|
});
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
679
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
680
|
+
};
|
|
681
|
+
const deserializeAws_restJson1InvalidSnsTopicArnExceptionResponse = async (parsedOutput, context) => {
|
|
682
|
+
const contents = map({});
|
|
683
|
+
const data = parsedOutput.body;
|
|
684
|
+
if (data.message != null) {
|
|
685
|
+
contents.message = __expectString(data.message);
|
|
686
|
+
}
|
|
687
|
+
const exception = new InvalidSnsTopicArnException({
|
|
688
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
689
|
+
...contents,
|
|
949
690
|
});
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
691
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
692
|
+
};
|
|
693
|
+
const deserializeAws_restJson1InvalidSsmlExceptionResponse = async (parsedOutput, context) => {
|
|
694
|
+
const contents = map({});
|
|
695
|
+
const data = parsedOutput.body;
|
|
696
|
+
if (data.message != null) {
|
|
697
|
+
contents.message = __expectString(data.message);
|
|
698
|
+
}
|
|
699
|
+
const exception = new InvalidSsmlException({
|
|
700
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
701
|
+
...contents,
|
|
961
702
|
});
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
703
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
704
|
+
};
|
|
705
|
+
const deserializeAws_restJson1InvalidTaskIdExceptionResponse = async (parsedOutput, context) => {
|
|
706
|
+
const contents = map({});
|
|
707
|
+
const data = parsedOutput.body;
|
|
708
|
+
if (data.message != null) {
|
|
709
|
+
contents.message = __expectString(data.message);
|
|
710
|
+
}
|
|
711
|
+
const exception = new InvalidTaskIdException({
|
|
712
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
713
|
+
...contents,
|
|
973
714
|
});
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
715
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
716
|
+
};
|
|
717
|
+
const deserializeAws_restJson1LanguageNotSupportedExceptionResponse = async (parsedOutput, context) => {
|
|
718
|
+
const contents = map({});
|
|
719
|
+
const data = parsedOutput.body;
|
|
720
|
+
if (data.message != null) {
|
|
721
|
+
contents.message = __expectString(data.message);
|
|
722
|
+
}
|
|
723
|
+
const exception = new LanguageNotSupportedException({
|
|
724
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
725
|
+
...contents,
|
|
985
726
|
});
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
727
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
728
|
+
};
|
|
729
|
+
const deserializeAws_restJson1LexiconNotFoundExceptionResponse = async (parsedOutput, context) => {
|
|
730
|
+
const contents = map({});
|
|
731
|
+
const data = parsedOutput.body;
|
|
732
|
+
if (data.message != null) {
|
|
733
|
+
contents.message = __expectString(data.message);
|
|
734
|
+
}
|
|
735
|
+
const exception = new LexiconNotFoundException({
|
|
736
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
737
|
+
...contents,
|
|
997
738
|
});
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
739
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
740
|
+
};
|
|
741
|
+
const deserializeAws_restJson1LexiconSizeExceededExceptionResponse = async (parsedOutput, context) => {
|
|
742
|
+
const contents = map({});
|
|
743
|
+
const data = parsedOutput.body;
|
|
744
|
+
if (data.message != null) {
|
|
745
|
+
contents.message = __expectString(data.message);
|
|
746
|
+
}
|
|
747
|
+
const exception = new LexiconSizeExceededException({
|
|
748
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
749
|
+
...contents,
|
|
1009
750
|
});
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
751
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
752
|
+
};
|
|
753
|
+
const deserializeAws_restJson1MarksNotSupportedForFormatExceptionResponse = async (parsedOutput, context) => {
|
|
754
|
+
const contents = map({});
|
|
755
|
+
const data = parsedOutput.body;
|
|
756
|
+
if (data.message != null) {
|
|
757
|
+
contents.message = __expectString(data.message);
|
|
758
|
+
}
|
|
759
|
+
const exception = new MarksNotSupportedForFormatException({
|
|
760
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
761
|
+
...contents,
|
|
1021
762
|
});
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
763
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
764
|
+
};
|
|
765
|
+
const deserializeAws_restJson1MaxLexemeLengthExceededExceptionResponse = async (parsedOutput, context) => {
|
|
766
|
+
const contents = map({});
|
|
767
|
+
const data = parsedOutput.body;
|
|
768
|
+
if (data.message != null) {
|
|
769
|
+
contents.message = __expectString(data.message);
|
|
770
|
+
}
|
|
771
|
+
const exception = new MaxLexemeLengthExceededException({
|
|
772
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
773
|
+
...contents,
|
|
1033
774
|
});
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
775
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
776
|
+
};
|
|
777
|
+
const deserializeAws_restJson1MaxLexiconsNumberExceededExceptionResponse = async (parsedOutput, context) => {
|
|
778
|
+
const contents = map({});
|
|
779
|
+
const data = parsedOutput.body;
|
|
780
|
+
if (data.message != null) {
|
|
781
|
+
contents.message = __expectString(data.message);
|
|
782
|
+
}
|
|
783
|
+
const exception = new MaxLexiconsNumberExceededException({
|
|
784
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
785
|
+
...contents,
|
|
1045
786
|
});
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
787
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
788
|
+
};
|
|
789
|
+
const deserializeAws_restJson1ServiceFailureExceptionResponse = async (parsedOutput, context) => {
|
|
790
|
+
const contents = map({});
|
|
791
|
+
const data = parsedOutput.body;
|
|
792
|
+
if (data.message != null) {
|
|
793
|
+
contents.message = __expectString(data.message);
|
|
794
|
+
}
|
|
795
|
+
const exception = new ServiceFailureException({
|
|
796
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
797
|
+
...contents,
|
|
1057
798
|
});
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
799
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
800
|
+
};
|
|
801
|
+
const deserializeAws_restJson1SsmlMarksNotSupportedForTextTypeExceptionResponse = async (parsedOutput, context) => {
|
|
802
|
+
const contents = map({});
|
|
803
|
+
const data = parsedOutput.body;
|
|
804
|
+
if (data.message != null) {
|
|
805
|
+
contents.message = __expectString(data.message);
|
|
806
|
+
}
|
|
807
|
+
const exception = new SsmlMarksNotSupportedForTextTypeException({
|
|
808
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
809
|
+
...contents,
|
|
1069
810
|
});
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
811
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
812
|
+
};
|
|
813
|
+
const deserializeAws_restJson1SynthesisTaskNotFoundExceptionResponse = async (parsedOutput, context) => {
|
|
814
|
+
const contents = map({});
|
|
815
|
+
const data = parsedOutput.body;
|
|
816
|
+
if (data.message != null) {
|
|
817
|
+
contents.message = __expectString(data.message);
|
|
818
|
+
}
|
|
819
|
+
const exception = new SynthesisTaskNotFoundException({
|
|
820
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
821
|
+
...contents,
|
|
1081
822
|
});
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
823
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
824
|
+
};
|
|
825
|
+
const deserializeAws_restJson1TextLengthExceededExceptionResponse = async (parsedOutput, context) => {
|
|
826
|
+
const contents = map({});
|
|
827
|
+
const data = parsedOutput.body;
|
|
828
|
+
if (data.message != null) {
|
|
829
|
+
contents.message = __expectString(data.message);
|
|
830
|
+
}
|
|
831
|
+
const exception = new TextLengthExceededException({
|
|
832
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
833
|
+
...contents,
|
|
1093
834
|
});
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
835
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
836
|
+
};
|
|
837
|
+
const deserializeAws_restJson1UnsupportedPlsAlphabetExceptionResponse = async (parsedOutput, context) => {
|
|
838
|
+
const contents = map({});
|
|
839
|
+
const data = parsedOutput.body;
|
|
840
|
+
if (data.message != null) {
|
|
841
|
+
contents.message = __expectString(data.message);
|
|
842
|
+
}
|
|
843
|
+
const exception = new UnsupportedPlsAlphabetException({
|
|
844
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
845
|
+
...contents,
|
|
1105
846
|
});
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
847
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
848
|
+
};
|
|
849
|
+
const deserializeAws_restJson1UnsupportedPlsLanguageExceptionResponse = async (parsedOutput, context) => {
|
|
850
|
+
const contents = map({});
|
|
851
|
+
const data = parsedOutput.body;
|
|
852
|
+
if (data.message != null) {
|
|
853
|
+
contents.message = __expectString(data.message);
|
|
854
|
+
}
|
|
855
|
+
const exception = new UnsupportedPlsLanguageException({
|
|
856
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
857
|
+
...contents,
|
|
1117
858
|
});
|
|
1118
|
-
|
|
1119
|
-
|
|
859
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
860
|
+
};
|
|
861
|
+
const serializeAws_restJson1LexiconNameList = (input, context) => {
|
|
1120
862
|
return input
|
|
1121
|
-
.filter(
|
|
1122
|
-
.map(
|
|
863
|
+
.filter((e) => e != null)
|
|
864
|
+
.map((entry) => {
|
|
1123
865
|
return entry;
|
|
1124
866
|
});
|
|
1125
867
|
};
|
|
1126
|
-
|
|
868
|
+
const serializeAws_restJson1SpeechMarkTypeList = (input, context) => {
|
|
1127
869
|
return input
|
|
1128
|
-
.filter(
|
|
1129
|
-
.map(
|
|
870
|
+
.filter((e) => e != null)
|
|
871
|
+
.map((entry) => {
|
|
1130
872
|
return entry;
|
|
1131
873
|
});
|
|
1132
874
|
};
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
.filter(
|
|
1136
|
-
.map(
|
|
875
|
+
const deserializeAws_restJson1EngineList = (output, context) => {
|
|
876
|
+
const retVal = (output || [])
|
|
877
|
+
.filter((e) => e != null)
|
|
878
|
+
.map((entry) => {
|
|
1137
879
|
if (entry === null) {
|
|
1138
880
|
return null;
|
|
1139
881
|
}
|
|
@@ -1141,10 +883,10 @@ var deserializeAws_restJson1EngineList = function (output, context) {
|
|
|
1141
883
|
});
|
|
1142
884
|
return retVal;
|
|
1143
885
|
};
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
.filter(
|
|
1147
|
-
.map(
|
|
886
|
+
const deserializeAws_restJson1LanguageCodeList = (output, context) => {
|
|
887
|
+
const retVal = (output || [])
|
|
888
|
+
.filter((e) => e != null)
|
|
889
|
+
.map((entry) => {
|
|
1148
890
|
if (entry === null) {
|
|
1149
891
|
return null;
|
|
1150
892
|
}
|
|
@@ -1152,13 +894,13 @@ var deserializeAws_restJson1LanguageCodeList = function (output, context) {
|
|
|
1152
894
|
});
|
|
1153
895
|
return retVal;
|
|
1154
896
|
};
|
|
1155
|
-
|
|
897
|
+
const deserializeAws_restJson1Lexicon = (output, context) => {
|
|
1156
898
|
return {
|
|
1157
899
|
Content: __expectString(output.Content),
|
|
1158
900
|
Name: __expectString(output.Name),
|
|
1159
901
|
};
|
|
1160
902
|
};
|
|
1161
|
-
|
|
903
|
+
const deserializeAws_restJson1LexiconAttributes = (output, context) => {
|
|
1162
904
|
return {
|
|
1163
905
|
Alphabet: __expectString(output.Alphabet),
|
|
1164
906
|
LanguageCode: __expectString(output.LanguageCode),
|
|
@@ -1170,16 +912,16 @@ var deserializeAws_restJson1LexiconAttributes = function (output, context) {
|
|
|
1170
912
|
Size: __expectInt32(output.Size),
|
|
1171
913
|
};
|
|
1172
914
|
};
|
|
1173
|
-
|
|
915
|
+
const deserializeAws_restJson1LexiconDescription = (output, context) => {
|
|
1174
916
|
return {
|
|
1175
917
|
Attributes: output.Attributes != null ? deserializeAws_restJson1LexiconAttributes(output.Attributes, context) : undefined,
|
|
1176
918
|
Name: __expectString(output.Name),
|
|
1177
919
|
};
|
|
1178
920
|
};
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
.filter(
|
|
1182
|
-
.map(
|
|
921
|
+
const deserializeAws_restJson1LexiconDescriptionList = (output, context) => {
|
|
922
|
+
const retVal = (output || [])
|
|
923
|
+
.filter((e) => e != null)
|
|
924
|
+
.map((entry) => {
|
|
1183
925
|
if (entry === null) {
|
|
1184
926
|
return null;
|
|
1185
927
|
}
|
|
@@ -1187,10 +929,10 @@ var deserializeAws_restJson1LexiconDescriptionList = function (output, context)
|
|
|
1187
929
|
});
|
|
1188
930
|
return retVal;
|
|
1189
931
|
};
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
.filter(
|
|
1193
|
-
.map(
|
|
932
|
+
const deserializeAws_restJson1LexiconNameList = (output, context) => {
|
|
933
|
+
const retVal = (output || [])
|
|
934
|
+
.filter((e) => e != null)
|
|
935
|
+
.map((entry) => {
|
|
1194
936
|
if (entry === null) {
|
|
1195
937
|
return null;
|
|
1196
938
|
}
|
|
@@ -1198,10 +940,10 @@ var deserializeAws_restJson1LexiconNameList = function (output, context) {
|
|
|
1198
940
|
});
|
|
1199
941
|
return retVal;
|
|
1200
942
|
};
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
.filter(
|
|
1204
|
-
.map(
|
|
943
|
+
const deserializeAws_restJson1SpeechMarkTypeList = (output, context) => {
|
|
944
|
+
const retVal = (output || [])
|
|
945
|
+
.filter((e) => e != null)
|
|
946
|
+
.map((entry) => {
|
|
1205
947
|
if (entry === null) {
|
|
1206
948
|
return null;
|
|
1207
949
|
}
|
|
@@ -1209,7 +951,7 @@ var deserializeAws_restJson1SpeechMarkTypeList = function (output, context) {
|
|
|
1209
951
|
});
|
|
1210
952
|
return retVal;
|
|
1211
953
|
};
|
|
1212
|
-
|
|
954
|
+
const deserializeAws_restJson1SynthesisTask = (output, context) => {
|
|
1213
955
|
return {
|
|
1214
956
|
CreationTime: output.CreationTime != null
|
|
1215
957
|
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreationTime)))
|
|
@@ -1232,10 +974,10 @@ var deserializeAws_restJson1SynthesisTask = function (output, context) {
|
|
|
1232
974
|
VoiceId: __expectString(output.VoiceId),
|
|
1233
975
|
};
|
|
1234
976
|
};
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
.filter(
|
|
1238
|
-
.map(
|
|
977
|
+
const deserializeAws_restJson1SynthesisTasks = (output, context) => {
|
|
978
|
+
const retVal = (output || [])
|
|
979
|
+
.filter((e) => e != null)
|
|
980
|
+
.map((entry) => {
|
|
1239
981
|
if (entry === null) {
|
|
1240
982
|
return null;
|
|
1241
983
|
}
|
|
@@ -1243,7 +985,7 @@ var deserializeAws_restJson1SynthesisTasks = function (output, context) {
|
|
|
1243
985
|
});
|
|
1244
986
|
return retVal;
|
|
1245
987
|
};
|
|
1246
|
-
|
|
988
|
+
const deserializeAws_restJson1Voice = (output, context) => {
|
|
1247
989
|
return {
|
|
1248
990
|
AdditionalLanguageCodes: output.AdditionalLanguageCodes != null
|
|
1249
991
|
? deserializeAws_restJson1LanguageCodeList(output.AdditionalLanguageCodes, context)
|
|
@@ -1258,10 +1000,10 @@ var deserializeAws_restJson1Voice = function (output, context) {
|
|
|
1258
1000
|
: undefined,
|
|
1259
1001
|
};
|
|
1260
1002
|
};
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
.filter(
|
|
1264
|
-
.map(
|
|
1003
|
+
const deserializeAws_restJson1VoiceList = (output, context) => {
|
|
1004
|
+
const retVal = (output || [])
|
|
1005
|
+
.filter((e) => e != null)
|
|
1006
|
+
.map((entry) => {
|
|
1265
1007
|
if (entry === null) {
|
|
1266
1008
|
return null;
|
|
1267
1009
|
}
|
|
@@ -1269,57 +1011,39 @@ var deserializeAws_restJson1VoiceList = function (output, context) {
|
|
|
1269
1011
|
});
|
|
1270
1012
|
return retVal;
|
|
1271
1013
|
};
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
});
|
|
1280
|
-
};
|
|
1281
|
-
var collectBody = function (streamBody, context) {
|
|
1282
|
-
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
1014
|
+
const deserializeMetadata = (output) => ({
|
|
1015
|
+
httpStatusCode: output.statusCode,
|
|
1016
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
|
|
1017
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
1018
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
1019
|
+
});
|
|
1020
|
+
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
1283
1021
|
if (streamBody instanceof Uint8Array) {
|
|
1284
1022
|
return Promise.resolve(streamBody);
|
|
1285
1023
|
}
|
|
1286
1024
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
1287
1025
|
};
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
}
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
});
|
|
1026
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
1027
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
1028
|
+
value !== null &&
|
|
1029
|
+
value !== "" &&
|
|
1030
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
1031
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
1032
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
1033
|
+
if (encoded.length) {
|
|
1034
|
+
return JSON.parse(encoded);
|
|
1035
|
+
}
|
|
1036
|
+
return {};
|
|
1037
|
+
});
|
|
1038
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
1039
|
+
const value = await parseBody(errorBody, context);
|
|
1040
|
+
value.message = value.message ?? value.Message;
|
|
1041
|
+
return value;
|
|
1305
1042
|
};
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
switch (_b.label) {
|
|
1311
|
-
case 0: return [4, parseBody(errorBody, context)];
|
|
1312
|
-
case 1:
|
|
1313
|
-
value = _b.sent();
|
|
1314
|
-
value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
|
|
1315
|
-
return [2, value];
|
|
1316
|
-
}
|
|
1317
|
-
});
|
|
1318
|
-
}); };
|
|
1319
|
-
var loadRestJsonErrorCode = function (output, data) {
|
|
1320
|
-
var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
|
|
1321
|
-
var sanitizeErrorCode = function (rawValue) {
|
|
1322
|
-
var cleanValue = rawValue;
|
|
1043
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
1044
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
1045
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
1046
|
+
let cleanValue = rawValue;
|
|
1323
1047
|
if (typeof cleanValue === "number") {
|
|
1324
1048
|
cleanValue = cleanValue.toString();
|
|
1325
1049
|
}
|
|
@@ -1334,7 +1058,7 @@ var loadRestJsonErrorCode = function (output, data) {
|
|
|
1334
1058
|
}
|
|
1335
1059
|
return cleanValue;
|
|
1336
1060
|
};
|
|
1337
|
-
|
|
1061
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
1338
1062
|
if (headerKey !== undefined) {
|
|
1339
1063
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
1340
1064
|
}
|