@aws-sdk/client-polly 3.928.0 → 3.930.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.
Files changed (33) hide show
  1. package/dist-cjs/index.js +722 -811
  2. package/dist-cjs/runtimeConfig.shared.js +2 -0
  3. package/dist-es/PollyClient.js +2 -0
  4. package/dist-es/commands/DeleteLexiconCommand.js +3 -9
  5. package/dist-es/commands/DescribeVoicesCommand.js +3 -9
  6. package/dist-es/commands/GetLexiconCommand.js +3 -10
  7. package/dist-es/commands/GetSpeechSynthesisTaskCommand.js +3 -9
  8. package/dist-es/commands/ListLexiconsCommand.js +3 -9
  9. package/dist-es/commands/ListSpeechSynthesisTasksCommand.js +3 -9
  10. package/dist-es/commands/PutLexiconCommand.js +3 -10
  11. package/dist-es/commands/StartSpeechSynthesisTaskCommand.js +3 -9
  12. package/dist-es/commands/SynthesizeSpeechCommand.js +3 -10
  13. package/dist-es/models/models_0.js +0 -16
  14. package/dist-es/runtimeConfig.shared.js +2 -0
  15. package/dist-es/schemas/schemas_0.js +649 -0
  16. package/dist-types/PollyClient.d.ts +10 -1
  17. package/dist-types/models/models_0.d.ts +0 -16
  18. package/dist-types/runtimeConfig.browser.d.ts +1 -0
  19. package/dist-types/runtimeConfig.d.ts +1 -0
  20. package/dist-types/runtimeConfig.native.d.ts +1 -0
  21. package/dist-types/runtimeConfig.shared.d.ts +1 -0
  22. package/dist-types/schemas/schemas_0.d.ts +65 -0
  23. package/dist-types/ts3.4/PollyClient.d.ts +4 -0
  24. package/dist-types/ts3.4/models/models_0.d.ts +0 -10
  25. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +4 -0
  26. package/dist-types/ts3.4/runtimeConfig.d.ts +4 -0
  27. package/dist-types/ts3.4/runtimeConfig.native.d.ts +4 -0
  28. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +4 -0
  29. package/dist-types/ts3.4/schemas/schemas_0.d.ts +71 -0
  30. package/package.json +34 -34
  31. package/dist-es/protocols/Aws_restJson1.js +0 -672
  32. package/dist-types/protocols/Aws_restJson1.d.ts +0 -83
  33. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +0 -116
@@ -1,672 +0,0 @@
1
- import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
2
- import { requestBuilder as rb } from "@smithy/core";
3
- import { _json, collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, strictParseInt32 as __strictParseInt32, take, withBaseException, } from "@smithy/smithy-client";
4
- 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
- import { PollyServiceException as __BaseException } from "../models/PollyServiceException";
6
- export const se_DeleteLexiconCommand = async (input, context) => {
7
- const b = rb(input, context);
8
- const headers = {};
9
- b.bp("/v1/lexicons/{Name}");
10
- b.p("Name", () => input.Name, "{Name}", false);
11
- let body;
12
- b.m("DELETE").h(headers).b(body);
13
- return b.build();
14
- };
15
- export const se_DescribeVoicesCommand = async (input, context) => {
16
- const b = rb(input, context);
17
- const headers = {};
18
- b.bp("/v1/voices");
19
- const query = map({
20
- [_E]: [, input[_E]],
21
- [_LC]: [, input[_LC]],
22
- [_IALC]: [() => input.IncludeAdditionalLanguageCodes !== void 0, () => input[_IALC].toString()],
23
- [_NT]: [, input[_NT]],
24
- });
25
- let body;
26
- b.m("GET").h(headers).q(query).b(body);
27
- return b.build();
28
- };
29
- export const se_GetLexiconCommand = async (input, context) => {
30
- const b = rb(input, context);
31
- const headers = {};
32
- b.bp("/v1/lexicons/{Name}");
33
- b.p("Name", () => input.Name, "{Name}", false);
34
- let body;
35
- b.m("GET").h(headers).b(body);
36
- return b.build();
37
- };
38
- export const se_GetSpeechSynthesisTaskCommand = async (input, context) => {
39
- const b = rb(input, context);
40
- const headers = {};
41
- b.bp("/v1/synthesisTasks/{TaskId}");
42
- b.p("TaskId", () => input.TaskId, "{TaskId}", false);
43
- let body;
44
- b.m("GET").h(headers).b(body);
45
- return b.build();
46
- };
47
- export const se_ListLexiconsCommand = async (input, context) => {
48
- const b = rb(input, context);
49
- const headers = {};
50
- b.bp("/v1/lexicons");
51
- const query = map({
52
- [_NT]: [, input[_NT]],
53
- });
54
- let body;
55
- b.m("GET").h(headers).q(query).b(body);
56
- return b.build();
57
- };
58
- export const se_ListSpeechSynthesisTasksCommand = async (input, context) => {
59
- const b = rb(input, context);
60
- const headers = {};
61
- b.bp("/v1/synthesisTasks");
62
- const query = map({
63
- [_MR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
64
- [_NT]: [, input[_NT]],
65
- [_S]: [, input[_S]],
66
- });
67
- let body;
68
- b.m("GET").h(headers).q(query).b(body);
69
- return b.build();
70
- };
71
- export const se_PutLexiconCommand = async (input, context) => {
72
- const b = rb(input, context);
73
- const headers = {
74
- "content-type": "application/json",
75
- };
76
- b.bp("/v1/lexicons/{Name}");
77
- b.p("Name", () => input.Name, "{Name}", false);
78
- let body;
79
- body = JSON.stringify(take(input, {
80
- Content: [],
81
- }));
82
- b.m("PUT").h(headers).b(body);
83
- return b.build();
84
- };
85
- export const se_StartSpeechSynthesisTaskCommand = async (input, context) => {
86
- const b = rb(input, context);
87
- const headers = {
88
- "content-type": "application/json",
89
- };
90
- b.bp("/v1/synthesisTasks");
91
- let body;
92
- body = JSON.stringify(take(input, {
93
- Engine: [],
94
- LanguageCode: [],
95
- LexiconNames: (_) => _json(_),
96
- OutputFormat: [],
97
- OutputS3BucketName: [],
98
- OutputS3KeyPrefix: [],
99
- SampleRate: [],
100
- SnsTopicArn: [],
101
- SpeechMarkTypes: (_) => _json(_),
102
- Text: [],
103
- TextType: [],
104
- VoiceId: [],
105
- }));
106
- b.m("POST").h(headers).b(body);
107
- return b.build();
108
- };
109
- export const se_SynthesizeSpeechCommand = async (input, context) => {
110
- const b = rb(input, context);
111
- const headers = {
112
- "content-type": "application/json",
113
- };
114
- b.bp("/v1/speech");
115
- let body;
116
- body = JSON.stringify(take(input, {
117
- Engine: [],
118
- LanguageCode: [],
119
- LexiconNames: (_) => _json(_),
120
- OutputFormat: [],
121
- SampleRate: [],
122
- SpeechMarkTypes: (_) => _json(_),
123
- Text: [],
124
- TextType: [],
125
- VoiceId: [],
126
- }));
127
- b.m("POST").h(headers).b(body);
128
- return b.build();
129
- };
130
- export const de_DeleteLexiconCommand = async (output, context) => {
131
- if (output.statusCode !== 200 && output.statusCode >= 300) {
132
- return de_CommandError(output, context);
133
- }
134
- const contents = map({
135
- $metadata: deserializeMetadata(output),
136
- });
137
- await collectBody(output.body, context);
138
- return contents;
139
- };
140
- export const de_DescribeVoicesCommand = async (output, context) => {
141
- if (output.statusCode !== 200 && output.statusCode >= 300) {
142
- return de_CommandError(output, context);
143
- }
144
- const contents = map({
145
- $metadata: deserializeMetadata(output),
146
- });
147
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
148
- const doc = take(data, {
149
- NextToken: __expectString,
150
- Voices: _json,
151
- });
152
- Object.assign(contents, doc);
153
- return contents;
154
- };
155
- export const de_GetLexiconCommand = async (output, context) => {
156
- if (output.statusCode !== 200 && output.statusCode >= 300) {
157
- return de_CommandError(output, context);
158
- }
159
- const contents = map({
160
- $metadata: deserializeMetadata(output),
161
- });
162
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
163
- const doc = take(data, {
164
- Lexicon: _json,
165
- LexiconAttributes: (_) => de_LexiconAttributes(_, context),
166
- });
167
- Object.assign(contents, doc);
168
- return contents;
169
- };
170
- export const de_GetSpeechSynthesisTaskCommand = async (output, context) => {
171
- if (output.statusCode !== 200 && output.statusCode >= 300) {
172
- return de_CommandError(output, context);
173
- }
174
- const contents = map({
175
- $metadata: deserializeMetadata(output),
176
- });
177
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
178
- const doc = take(data, {
179
- SynthesisTask: (_) => de_SynthesisTask(_, context),
180
- });
181
- Object.assign(contents, doc);
182
- return contents;
183
- };
184
- export const de_ListLexiconsCommand = async (output, context) => {
185
- if (output.statusCode !== 200 && output.statusCode >= 300) {
186
- return de_CommandError(output, context);
187
- }
188
- const contents = map({
189
- $metadata: deserializeMetadata(output),
190
- });
191
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
192
- const doc = take(data, {
193
- Lexicons: (_) => de_LexiconDescriptionList(_, context),
194
- NextToken: __expectString,
195
- });
196
- Object.assign(contents, doc);
197
- return contents;
198
- };
199
- export const de_ListSpeechSynthesisTasksCommand = async (output, context) => {
200
- if (output.statusCode !== 200 && output.statusCode >= 300) {
201
- return de_CommandError(output, context);
202
- }
203
- const contents = map({
204
- $metadata: deserializeMetadata(output),
205
- });
206
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
207
- const doc = take(data, {
208
- NextToken: __expectString,
209
- SynthesisTasks: (_) => de_SynthesisTasks(_, context),
210
- });
211
- Object.assign(contents, doc);
212
- return contents;
213
- };
214
- export const de_PutLexiconCommand = async (output, context) => {
215
- if (output.statusCode !== 200 && output.statusCode >= 300) {
216
- return de_CommandError(output, context);
217
- }
218
- const contents = map({
219
- $metadata: deserializeMetadata(output),
220
- });
221
- await collectBody(output.body, context);
222
- return contents;
223
- };
224
- export const de_StartSpeechSynthesisTaskCommand = async (output, context) => {
225
- if (output.statusCode !== 200 && output.statusCode >= 300) {
226
- return de_CommandError(output, context);
227
- }
228
- const contents = map({
229
- $metadata: deserializeMetadata(output),
230
- });
231
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
232
- const doc = take(data, {
233
- SynthesisTask: (_) => de_SynthesisTask(_, context),
234
- });
235
- Object.assign(contents, doc);
236
- return contents;
237
- };
238
- export const de_SynthesizeSpeechCommand = async (output, context) => {
239
- if (output.statusCode !== 200 && output.statusCode >= 300) {
240
- return de_CommandError(output, context);
241
- }
242
- const contents = map({
243
- $metadata: deserializeMetadata(output),
244
- [_CT]: [, output.headers[_ct]],
245
- [_RC]: [() => void 0 !== output.headers[_xar], () => __strictParseInt32(output.headers[_xar])],
246
- });
247
- const data = output.body;
248
- context.sdkStreamMixin(data);
249
- contents.AudioStream = data;
250
- return contents;
251
- };
252
- const de_CommandError = async (output, context) => {
253
- const parsedOutput = {
254
- ...output,
255
- body: await parseErrorBody(output.body, context),
256
- };
257
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
258
- switch (errorCode) {
259
- case "LexiconNotFoundException":
260
- case "com.amazonaws.polly#LexiconNotFoundException":
261
- throw await de_LexiconNotFoundExceptionRes(parsedOutput, context);
262
- case "ServiceFailureException":
263
- case "com.amazonaws.polly#ServiceFailureException":
264
- throw await de_ServiceFailureExceptionRes(parsedOutput, context);
265
- case "InvalidNextTokenException":
266
- case "com.amazonaws.polly#InvalidNextTokenException":
267
- throw await de_InvalidNextTokenExceptionRes(parsedOutput, context);
268
- case "InvalidTaskIdException":
269
- case "com.amazonaws.polly#InvalidTaskIdException":
270
- throw await de_InvalidTaskIdExceptionRes(parsedOutput, context);
271
- case "SynthesisTaskNotFoundException":
272
- case "com.amazonaws.polly#SynthesisTaskNotFoundException":
273
- throw await de_SynthesisTaskNotFoundExceptionRes(parsedOutput, context);
274
- case "InvalidLexiconException":
275
- case "com.amazonaws.polly#InvalidLexiconException":
276
- throw await de_InvalidLexiconExceptionRes(parsedOutput, context);
277
- case "LexiconSizeExceededException":
278
- case "com.amazonaws.polly#LexiconSizeExceededException":
279
- throw await de_LexiconSizeExceededExceptionRes(parsedOutput, context);
280
- case "MaxLexemeLengthExceededException":
281
- case "com.amazonaws.polly#MaxLexemeLengthExceededException":
282
- throw await de_MaxLexemeLengthExceededExceptionRes(parsedOutput, context);
283
- case "MaxLexiconsNumberExceededException":
284
- case "com.amazonaws.polly#MaxLexiconsNumberExceededException":
285
- throw await de_MaxLexiconsNumberExceededExceptionRes(parsedOutput, context);
286
- case "UnsupportedPlsAlphabetException":
287
- case "com.amazonaws.polly#UnsupportedPlsAlphabetException":
288
- throw await de_UnsupportedPlsAlphabetExceptionRes(parsedOutput, context);
289
- case "UnsupportedPlsLanguageException":
290
- case "com.amazonaws.polly#UnsupportedPlsLanguageException":
291
- throw await de_UnsupportedPlsLanguageExceptionRes(parsedOutput, context);
292
- case "EngineNotSupportedException":
293
- case "com.amazonaws.polly#EngineNotSupportedException":
294
- throw await de_EngineNotSupportedExceptionRes(parsedOutput, context);
295
- case "InvalidS3BucketException":
296
- case "com.amazonaws.polly#InvalidS3BucketException":
297
- throw await de_InvalidS3BucketExceptionRes(parsedOutput, context);
298
- case "InvalidS3KeyException":
299
- case "com.amazonaws.polly#InvalidS3KeyException":
300
- throw await de_InvalidS3KeyExceptionRes(parsedOutput, context);
301
- case "InvalidSampleRateException":
302
- case "com.amazonaws.polly#InvalidSampleRateException":
303
- throw await de_InvalidSampleRateExceptionRes(parsedOutput, context);
304
- case "InvalidSnsTopicArnException":
305
- case "com.amazonaws.polly#InvalidSnsTopicArnException":
306
- throw await de_InvalidSnsTopicArnExceptionRes(parsedOutput, context);
307
- case "InvalidSsmlException":
308
- case "com.amazonaws.polly#InvalidSsmlException":
309
- throw await de_InvalidSsmlExceptionRes(parsedOutput, context);
310
- case "LanguageNotSupportedException":
311
- case "com.amazonaws.polly#LanguageNotSupportedException":
312
- throw await de_LanguageNotSupportedExceptionRes(parsedOutput, context);
313
- case "MarksNotSupportedForFormatException":
314
- case "com.amazonaws.polly#MarksNotSupportedForFormatException":
315
- throw await de_MarksNotSupportedForFormatExceptionRes(parsedOutput, context);
316
- case "SsmlMarksNotSupportedForTextTypeException":
317
- case "com.amazonaws.polly#SsmlMarksNotSupportedForTextTypeException":
318
- throw await de_SsmlMarksNotSupportedForTextTypeExceptionRes(parsedOutput, context);
319
- case "TextLengthExceededException":
320
- case "com.amazonaws.polly#TextLengthExceededException":
321
- throw await de_TextLengthExceededExceptionRes(parsedOutput, context);
322
- default:
323
- const parsedBody = parsedOutput.body;
324
- return throwDefaultError({
325
- output,
326
- parsedBody,
327
- errorCode,
328
- });
329
- }
330
- };
331
- const throwDefaultError = withBaseException(__BaseException);
332
- const de_EngineNotSupportedExceptionRes = async (parsedOutput, context) => {
333
- const contents = map({});
334
- const data = parsedOutput.body;
335
- const doc = take(data, {
336
- message: __expectString,
337
- });
338
- Object.assign(contents, doc);
339
- const exception = new EngineNotSupportedException({
340
- $metadata: deserializeMetadata(parsedOutput),
341
- ...contents,
342
- });
343
- return __decorateServiceException(exception, parsedOutput.body);
344
- };
345
- const de_InvalidLexiconExceptionRes = async (parsedOutput, context) => {
346
- const contents = map({});
347
- const data = parsedOutput.body;
348
- const doc = take(data, {
349
- message: __expectString,
350
- });
351
- Object.assign(contents, doc);
352
- const exception = new InvalidLexiconException({
353
- $metadata: deserializeMetadata(parsedOutput),
354
- ...contents,
355
- });
356
- return __decorateServiceException(exception, parsedOutput.body);
357
- };
358
- const de_InvalidNextTokenExceptionRes = async (parsedOutput, context) => {
359
- const contents = map({});
360
- const data = parsedOutput.body;
361
- const doc = take(data, {
362
- message: __expectString,
363
- });
364
- Object.assign(contents, doc);
365
- const exception = new InvalidNextTokenException({
366
- $metadata: deserializeMetadata(parsedOutput),
367
- ...contents,
368
- });
369
- return __decorateServiceException(exception, parsedOutput.body);
370
- };
371
- const de_InvalidS3BucketExceptionRes = async (parsedOutput, context) => {
372
- const contents = map({});
373
- const data = parsedOutput.body;
374
- const doc = take(data, {
375
- message: __expectString,
376
- });
377
- Object.assign(contents, doc);
378
- const exception = new InvalidS3BucketException({
379
- $metadata: deserializeMetadata(parsedOutput),
380
- ...contents,
381
- });
382
- return __decorateServiceException(exception, parsedOutput.body);
383
- };
384
- const de_InvalidS3KeyExceptionRes = async (parsedOutput, context) => {
385
- const contents = map({});
386
- const data = parsedOutput.body;
387
- const doc = take(data, {
388
- message: __expectString,
389
- });
390
- Object.assign(contents, doc);
391
- const exception = new InvalidS3KeyException({
392
- $metadata: deserializeMetadata(parsedOutput),
393
- ...contents,
394
- });
395
- return __decorateServiceException(exception, parsedOutput.body);
396
- };
397
- const de_InvalidSampleRateExceptionRes = async (parsedOutput, context) => {
398
- const contents = map({});
399
- const data = parsedOutput.body;
400
- const doc = take(data, {
401
- message: __expectString,
402
- });
403
- Object.assign(contents, doc);
404
- const exception = new InvalidSampleRateException({
405
- $metadata: deserializeMetadata(parsedOutput),
406
- ...contents,
407
- });
408
- return __decorateServiceException(exception, parsedOutput.body);
409
- };
410
- const de_InvalidSnsTopicArnExceptionRes = async (parsedOutput, context) => {
411
- const contents = map({});
412
- const data = parsedOutput.body;
413
- const doc = take(data, {
414
- message: __expectString,
415
- });
416
- Object.assign(contents, doc);
417
- const exception = new InvalidSnsTopicArnException({
418
- $metadata: deserializeMetadata(parsedOutput),
419
- ...contents,
420
- });
421
- return __decorateServiceException(exception, parsedOutput.body);
422
- };
423
- const de_InvalidSsmlExceptionRes = async (parsedOutput, context) => {
424
- const contents = map({});
425
- const data = parsedOutput.body;
426
- const doc = take(data, {
427
- message: __expectString,
428
- });
429
- Object.assign(contents, doc);
430
- const exception = new InvalidSsmlException({
431
- $metadata: deserializeMetadata(parsedOutput),
432
- ...contents,
433
- });
434
- return __decorateServiceException(exception, parsedOutput.body);
435
- };
436
- const de_InvalidTaskIdExceptionRes = async (parsedOutput, context) => {
437
- const contents = map({});
438
- const data = parsedOutput.body;
439
- const doc = take(data, {
440
- message: __expectString,
441
- });
442
- Object.assign(contents, doc);
443
- const exception = new InvalidTaskIdException({
444
- $metadata: deserializeMetadata(parsedOutput),
445
- ...contents,
446
- });
447
- return __decorateServiceException(exception, parsedOutput.body);
448
- };
449
- const de_LanguageNotSupportedExceptionRes = async (parsedOutput, context) => {
450
- const contents = map({});
451
- const data = parsedOutput.body;
452
- const doc = take(data, {
453
- message: __expectString,
454
- });
455
- Object.assign(contents, doc);
456
- const exception = new LanguageNotSupportedException({
457
- $metadata: deserializeMetadata(parsedOutput),
458
- ...contents,
459
- });
460
- return __decorateServiceException(exception, parsedOutput.body);
461
- };
462
- const de_LexiconNotFoundExceptionRes = async (parsedOutput, context) => {
463
- const contents = map({});
464
- const data = parsedOutput.body;
465
- const doc = take(data, {
466
- message: __expectString,
467
- });
468
- Object.assign(contents, doc);
469
- const exception = new LexiconNotFoundException({
470
- $metadata: deserializeMetadata(parsedOutput),
471
- ...contents,
472
- });
473
- return __decorateServiceException(exception, parsedOutput.body);
474
- };
475
- const de_LexiconSizeExceededExceptionRes = async (parsedOutput, context) => {
476
- const contents = map({});
477
- const data = parsedOutput.body;
478
- const doc = take(data, {
479
- message: __expectString,
480
- });
481
- Object.assign(contents, doc);
482
- const exception = new LexiconSizeExceededException({
483
- $metadata: deserializeMetadata(parsedOutput),
484
- ...contents,
485
- });
486
- return __decorateServiceException(exception, parsedOutput.body);
487
- };
488
- const de_MarksNotSupportedForFormatExceptionRes = async (parsedOutput, context) => {
489
- const contents = map({});
490
- const data = parsedOutput.body;
491
- const doc = take(data, {
492
- message: __expectString,
493
- });
494
- Object.assign(contents, doc);
495
- const exception = new MarksNotSupportedForFormatException({
496
- $metadata: deserializeMetadata(parsedOutput),
497
- ...contents,
498
- });
499
- return __decorateServiceException(exception, parsedOutput.body);
500
- };
501
- const de_MaxLexemeLengthExceededExceptionRes = async (parsedOutput, context) => {
502
- const contents = map({});
503
- const data = parsedOutput.body;
504
- const doc = take(data, {
505
- message: __expectString,
506
- });
507
- Object.assign(contents, doc);
508
- const exception = new MaxLexemeLengthExceededException({
509
- $metadata: deserializeMetadata(parsedOutput),
510
- ...contents,
511
- });
512
- return __decorateServiceException(exception, parsedOutput.body);
513
- };
514
- const de_MaxLexiconsNumberExceededExceptionRes = async (parsedOutput, context) => {
515
- const contents = map({});
516
- const data = parsedOutput.body;
517
- const doc = take(data, {
518
- message: __expectString,
519
- });
520
- Object.assign(contents, doc);
521
- const exception = new MaxLexiconsNumberExceededException({
522
- $metadata: deserializeMetadata(parsedOutput),
523
- ...contents,
524
- });
525
- return __decorateServiceException(exception, parsedOutput.body);
526
- };
527
- const de_ServiceFailureExceptionRes = async (parsedOutput, context) => {
528
- const contents = map({});
529
- const data = parsedOutput.body;
530
- const doc = take(data, {
531
- message: __expectString,
532
- });
533
- Object.assign(contents, doc);
534
- const exception = new ServiceFailureException({
535
- $metadata: deserializeMetadata(parsedOutput),
536
- ...contents,
537
- });
538
- return __decorateServiceException(exception, parsedOutput.body);
539
- };
540
- const de_SsmlMarksNotSupportedForTextTypeExceptionRes = async (parsedOutput, context) => {
541
- const contents = map({});
542
- const data = parsedOutput.body;
543
- const doc = take(data, {
544
- message: __expectString,
545
- });
546
- Object.assign(contents, doc);
547
- const exception = new SsmlMarksNotSupportedForTextTypeException({
548
- $metadata: deserializeMetadata(parsedOutput),
549
- ...contents,
550
- });
551
- return __decorateServiceException(exception, parsedOutput.body);
552
- };
553
- const de_SynthesisTaskNotFoundExceptionRes = async (parsedOutput, context) => {
554
- const contents = map({});
555
- const data = parsedOutput.body;
556
- const doc = take(data, {
557
- message: __expectString,
558
- });
559
- Object.assign(contents, doc);
560
- const exception = new SynthesisTaskNotFoundException({
561
- $metadata: deserializeMetadata(parsedOutput),
562
- ...contents,
563
- });
564
- return __decorateServiceException(exception, parsedOutput.body);
565
- };
566
- const de_TextLengthExceededExceptionRes = async (parsedOutput, context) => {
567
- const contents = map({});
568
- const data = parsedOutput.body;
569
- const doc = take(data, {
570
- message: __expectString,
571
- });
572
- Object.assign(contents, doc);
573
- const exception = new TextLengthExceededException({
574
- $metadata: deserializeMetadata(parsedOutput),
575
- ...contents,
576
- });
577
- return __decorateServiceException(exception, parsedOutput.body);
578
- };
579
- const de_UnsupportedPlsAlphabetExceptionRes = async (parsedOutput, context) => {
580
- const contents = map({});
581
- const data = parsedOutput.body;
582
- const doc = take(data, {
583
- message: __expectString,
584
- });
585
- Object.assign(contents, doc);
586
- const exception = new UnsupportedPlsAlphabetException({
587
- $metadata: deserializeMetadata(parsedOutput),
588
- ...contents,
589
- });
590
- return __decorateServiceException(exception, parsedOutput.body);
591
- };
592
- const de_UnsupportedPlsLanguageExceptionRes = async (parsedOutput, context) => {
593
- const contents = map({});
594
- const data = parsedOutput.body;
595
- const doc = take(data, {
596
- message: __expectString,
597
- });
598
- Object.assign(contents, doc);
599
- const exception = new UnsupportedPlsLanguageException({
600
- $metadata: deserializeMetadata(parsedOutput),
601
- ...contents,
602
- });
603
- return __decorateServiceException(exception, parsedOutput.body);
604
- };
605
- const de_LexiconAttributes = (output, context) => {
606
- return take(output, {
607
- Alphabet: __expectString,
608
- LanguageCode: __expectString,
609
- LastModified: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
610
- LexemesCount: __expectInt32,
611
- LexiconArn: __expectString,
612
- Size: __expectInt32,
613
- });
614
- };
615
- const de_LexiconDescription = (output, context) => {
616
- return take(output, {
617
- Attributes: (_) => de_LexiconAttributes(_, context),
618
- Name: __expectString,
619
- });
620
- };
621
- const de_LexiconDescriptionList = (output, context) => {
622
- const retVal = (output || [])
623
- .filter((e) => e != null)
624
- .map((entry) => {
625
- return de_LexiconDescription(entry, context);
626
- });
627
- return retVal;
628
- };
629
- const de_SynthesisTask = (output, context) => {
630
- return take(output, {
631
- CreationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
632
- Engine: __expectString,
633
- LanguageCode: __expectString,
634
- LexiconNames: _json,
635
- OutputFormat: __expectString,
636
- OutputUri: __expectString,
637
- RequestCharacters: __expectInt32,
638
- SampleRate: __expectString,
639
- SnsTopicArn: __expectString,
640
- SpeechMarkTypes: _json,
641
- TaskId: __expectString,
642
- TaskStatus: __expectString,
643
- TaskStatusReason: __expectString,
644
- TextType: __expectString,
645
- VoiceId: __expectString,
646
- });
647
- };
648
- const de_SynthesisTasks = (output, context) => {
649
- const retVal = (output || [])
650
- .filter((e) => e != null)
651
- .map((entry) => {
652
- return de_SynthesisTask(entry, context);
653
- });
654
- return retVal;
655
- };
656
- const deserializeMetadata = (output) => ({
657
- httpStatusCode: output.statusCode,
658
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
659
- extendedRequestId: output.headers["x-amz-id-2"],
660
- cfId: output.headers["x-amz-cf-id"],
661
- });
662
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
663
- const _CT = "ContentType";
664
- const _E = "Engine";
665
- const _IALC = "IncludeAdditionalLanguageCodes";
666
- const _LC = "LanguageCode";
667
- const _MR = "MaxResults";
668
- const _NT = "NextToken";
669
- const _RC = "RequestCharacters";
670
- const _S = "Status";
671
- const _ct = "content-type";
672
- const _xar = "x-amzn-requestcharacters";