@aws-sdk/client-polly 3.1172.0 → 3.1174.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 (47) hide show
  1. package/README.md +21 -0
  2. package/dist-cjs/index.js +384 -137
  3. package/dist-es/Polly.js +11 -1
  4. package/dist-es/commands/CreateVoiceCommand.js +4 -0
  5. package/dist-es/commands/DeleteVoiceCommand.js +4 -0
  6. package/dist-es/commands/GetVoiceCommand.js +4 -0
  7. package/dist-es/commands/index.js +3 -0
  8. package/dist-es/index.js +1 -0
  9. package/dist-es/models/enums.js +49 -21
  10. package/dist-es/models/errors.js +129 -97
  11. package/dist-es/schemas/schemas_0.js +125 -17
  12. package/dist-es/waiters/index.js +1 -0
  13. package/dist-es/waiters/waitForVoiceActive.js +40 -0
  14. package/dist-types/Polly.d.ts +29 -1
  15. package/dist-types/PollyClient.d.ts +5 -2
  16. package/dist-types/commands/CreateVoiceCommand.d.ts +174 -0
  17. package/dist-types/commands/DeleteVoiceCommand.d.ts +99 -0
  18. package/dist-types/commands/DescribeVoicesCommand.d.ts +45 -9
  19. package/dist-types/commands/GetVoiceCommand.d.ts +129 -0
  20. package/dist-types/commands/ListTagsForResourceCommand.d.ts +2 -2
  21. package/dist-types/commands/StartSpeechSynthesisStreamCommand.d.ts +26 -2
  22. package/dist-types/commands/StartSpeechSynthesisTaskCommand.d.ts +31 -10
  23. package/dist-types/commands/SynthesizeSpeechCommand.d.ts +24 -0
  24. package/dist-types/commands/TagResourceCommand.d.ts +2 -2
  25. package/dist-types/commands/UntagResourceCommand.d.ts +2 -2
  26. package/dist-types/commands/index.d.ts +3 -0
  27. package/dist-types/index.d.ts +1 -0
  28. package/dist-types/models/enums.d.ts +101 -41
  29. package/dist-types/models/errors.d.ts +183 -126
  30. package/dist-types/models/models_0.d.ts +369 -77
  31. package/dist-types/schemas/schemas_0.d.ts +15 -0
  32. package/dist-types/ts3.4/Polly.d.ts +47 -0
  33. package/dist-types/ts3.4/PollyClient.d.ts +9 -0
  34. package/dist-types/ts3.4/commands/CreateVoiceCommand.d.ts +38 -0
  35. package/dist-types/ts3.4/commands/DeleteVoiceCommand.d.ts +38 -0
  36. package/dist-types/ts3.4/commands/GetVoiceCommand.d.ts +38 -0
  37. package/dist-types/ts3.4/commands/index.d.ts +3 -0
  38. package/dist-types/ts3.4/index.d.ts +1 -0
  39. package/dist-types/ts3.4/models/enums.d.ts +60 -27
  40. package/dist-types/ts3.4/models/errors.d.ts +61 -46
  41. package/dist-types/ts3.4/models/models_0.d.ts +64 -16
  42. package/dist-types/ts3.4/schemas/schemas_0.d.ts +15 -0
  43. package/dist-types/ts3.4/waiters/index.d.ts +1 -0
  44. package/dist-types/ts3.4/waiters/waitForVoiceActive.d.ts +12 -0
  45. package/dist-types/waiters/index.d.ts +1 -0
  46. package/dist-types/waiters/waitForVoiceActive.d.ts +15 -0
  47. package/package.json +1 -1
@@ -1,26 +1,41 @@
1
1
  const _A = "Alphabet";
2
2
  const _AC = "AudioChunk";
3
+ const _ADE = "AccessDeniedException";
3
4
  const _AE = "AudioEvent";
4
5
  const _ALC = "AdditionalLanguageCodes";
5
6
  const _AS = "AudioStream";
6
7
  const _ASc = "ActionStream";
8
+ const _Ar = "Arn";
7
9
  const _At = "Attributes";
10
+ const _B = "Bytes";
8
11
  const _C = "Content";
12
+ const _CE = "ConflictException";
13
+ const _CME = "CustomerManagedEncryption";
9
14
  const _CSE = "CloseStreamEvent";
10
- const _CT = "CreationTime";
15
+ const _CT = "ClientToken";
11
16
  const _CT_ = "Content-Type";
12
17
  const _CTo = "ContentType";
18
+ const _CTr = "CreationTime";
19
+ const _CV = "CreateVoice";
20
+ const _CVI = "CreateVoiceInput";
21
+ const _CVO = "CreateVoiceOutput";
22
+ const _D = "Data";
13
23
  const _DL = "DeleteLexicon";
14
24
  const _DLI = "DeleteLexiconInput";
15
25
  const _DLO = "DeleteLexiconOutput";
16
- const _DV = "DescribeVoices";
17
- const _DVI = "DescribeVoicesInput";
18
- const _DVO = "DescribeVoicesOutput";
26
+ const _DV = "DeleteVoice";
27
+ const _DVI = "DeleteVoiceInput";
28
+ const _DVIe = "DescribeVoicesInput";
29
+ const _DVO = "DeleteVoiceOutput";
30
+ const _DVOe = "DescribeVoicesOutput";
31
+ const _DVe = "DescribeVoices";
19
32
  const _E = "Engine";
33
+ const _EC = "EncryptionContext";
20
34
  const _ENSE = "EngineNotSupportedException";
21
35
  const _ES = "EventStream";
22
36
  const _F = "Force";
23
37
  const _FSC = "FlushStreamConfiguration";
38
+ const _Fo = "Format";
24
39
  const _G = "Gender";
25
40
  const _GL = "GetLexicon";
26
41
  const _GLI = "GetLexiconInput";
@@ -28,6 +43,9 @@ const _GLO = "GetLexiconOutput";
28
43
  const _GSST = "GetSpeechSynthesisTask";
29
44
  const _GSSTI = "GetSpeechSynthesisTaskInput";
30
45
  const _GSSTO = "GetSpeechSynthesisTaskOutput";
46
+ const _GV = "GetVoice";
47
+ const _GVI = "GetVoiceInput";
48
+ const _GVO = "GetVoiceOutput";
31
49
  const _I = "Id";
32
50
  const _IALC = "IncludeAdditionalLanguageCodes";
33
51
  const _ILE = "InvalidLexiconException";
@@ -39,6 +57,7 @@ const _ISRE = "InvalidSampleRateException";
39
57
  const _ISTAE = "InvalidSnsTopicArnException";
40
58
  const _ITIE = "InvalidTaskIdException";
41
59
  const _ITPE = "InvalidTagParameterException";
60
+ const _KKA = "KmsKeyArn";
42
61
  const _L = "Lexicon";
43
62
  const _LA = "LexiconAttributes";
44
63
  const _LAe = "LexiconArn";
@@ -63,12 +82,14 @@ const _LTFR = "ListTagsForResource";
63
82
  const _LTFRI = "ListTagsForResourceInput";
64
83
  const _LTFRO = "ListTagsForResourceOutput";
65
84
  const _Le = "Lexicons";
85
+ const _M = "Message";
66
86
  const _MLLEE = "MaxLexemeLengthExceededException";
67
87
  const _MLNEE = "MaxLexiconsNumberExceededException";
68
88
  const _MNSFFE = "MarksNotSupportedForFormatException";
69
89
  const _MR = "MaxResults";
70
90
  const _N = "Name";
71
91
  const _NT = "NextToken";
92
+ const _O = "Origin";
72
93
  const _OF = "OutputFormat";
73
94
  const _OSBN = "OutputS3BucketName";
74
95
  const _OSKP = "OutputS3KeyPrefix";
@@ -76,9 +97,14 @@ const _OU = "OutputUri";
76
97
  const _PL = "PutLexicon";
77
98
  const _PLI = "PutLexiconInput";
78
99
  const _PLO = "PutLexiconOutput";
100
+ const _R = "Recording";
79
101
  const _RA = "ResourceArn";
102
+ const _RB = "RecordingBytes";
80
103
  const _RC = "RequestCharacters";
104
+ const _RD = "RecordingData";
105
+ const _RL = "RecordingList";
81
106
  const _RNFE = "ResourceNotFoundException";
107
+ const _Re = "Recordings";
82
108
  const _S = "Size";
83
109
  const _SCE = "StreamClosedEvent";
84
110
  const _SE = "SupportedEngines";
@@ -87,6 +113,7 @@ const _SMNSFTTE = "SsmlMarksNotSupportedForTextTypeException";
87
113
  const _SMT = "SpeechMarkTypes";
88
114
  const _SQEE = "ServiceQuotaExceededException";
89
115
  const _SR = "SampleRate";
116
+ const _SRt = "StatusReason";
90
117
  const _SS = "SynthesizeSpeech";
91
118
  const _SSI = "SynthesizeSpeechInput";
92
119
  const _SSO = "SynthesizeSpeechOutput";
@@ -102,8 +129,10 @@ const _ST = "SynthesisTask";
102
129
  const _STA = "SnsTopicArn";
103
130
  const _STNFE = "SynthesisTaskNotFoundException";
104
131
  const _STy = "SynthesisTasks";
132
+ const _SU = "S3Url";
105
133
  const _St = "Status";
106
134
  const _T = "Tags";
135
+ const _TA = "TermsAccepted";
107
136
  const _TE = "ThrottlingException";
108
137
  const _TEe = "TextEvent";
109
138
  const _TI = "TaskId";
@@ -124,13 +153,14 @@ const _UPLE = "UnsupportedPlsLanguageException";
124
153
  const _UR = "UntagResource";
125
154
  const _URI = "UntagResourceInput";
126
155
  const _URO = "UntagResourceOutput";
127
- const _V = "Voices";
156
+ const _V = "Voice";
157
+ const _VCD = "VoiceCreationData";
128
158
  const _VE = "ValidationException";
129
159
  const _VEF = "ValidationExceptionField";
130
160
  const _VEFL = "ValidationExceptionFieldList";
131
161
  const _VI = "VoiceId";
132
162
  const _VL = "VoiceList";
133
- const _Vo = "Voice";
163
+ const _Vo = "Voices";
134
164
  const _a = "arn";
135
165
  const _aQE = "awsQueryError";
136
166
  const _c = "client";
@@ -162,12 +192,24 @@ const _xaS = "x-amzn-SampleRate";
162
192
  const _xaV = "x-amzn-VoiceId";
163
193
  const n0 = "com.amazonaws.polly";
164
194
  import { TypeRegistry } from "@smithy/core/schema";
165
- import { EngineNotSupportedException, InvalidLexiconException, InvalidNextTokenException, InvalidS3BucketException, InvalidS3KeyException, InvalidSampleRateException, InvalidSnsTopicArnException, InvalidSsmlException, InvalidTagParameterException, InvalidTaskIdException, LanguageNotSupportedException, LexiconNotFoundException, LexiconSizeExceededException, MarksNotSupportedForFormatException, MaxLexemeLengthExceededException, MaxLexiconsNumberExceededException, ResourceNotFoundException, ServiceFailureException, ServiceQuotaExceededException, SsmlMarksNotSupportedForTextTypeException, SynthesisTaskNotFoundException, TextLengthExceededException, ThrottlingException, TooManyTagsException, UnsupportedPlsAlphabetException, UnsupportedPlsLanguageException, ValidationException, } from "../models/errors";
195
+ import { AccessDeniedException, ConflictException, EngineNotSupportedException, InvalidLexiconException, InvalidNextTokenException, InvalidS3BucketException, InvalidS3KeyException, InvalidSampleRateException, InvalidSnsTopicArnException, InvalidSsmlException, InvalidTagParameterException, InvalidTaskIdException, LanguageNotSupportedException, LexiconNotFoundException, LexiconSizeExceededException, MarksNotSupportedForFormatException, MaxLexemeLengthExceededException, MaxLexiconsNumberExceededException, ResourceNotFoundException, ServiceFailureException, ServiceQuotaExceededException, SsmlMarksNotSupportedForTextTypeException, SynthesisTaskNotFoundException, TextLengthExceededException, ThrottlingException, TooManyTagsException, UnsupportedPlsAlphabetException, UnsupportedPlsLanguageException, ValidationException, } from "../models/errors";
166
196
  import { PollyServiceException } from "../models/PollyServiceException";
167
197
  const _s_registry = new TypeRegistry(_s);
168
198
  export var PollyServiceException$ = [-3, _s, "PollyServiceException", 0, [], []];
169
199
  _s_registry.registerError(PollyServiceException$, PollyServiceException);
170
200
  const n0_registry = new TypeRegistry(n0);
201
+ export var AccessDeniedException$ = [-3, n0, _ADE,
202
+ { [_aQE]: [`AccessDenied`, 403], [_e]: _c, [_hE]: 403 },
203
+ [_M],
204
+ [0]
205
+ ];
206
+ n0_registry.registerError(AccessDeniedException$, AccessDeniedException);
207
+ export var ConflictException$ = [-3, n0, _CE,
208
+ { [_e]: _c, [_hE]: 409 },
209
+ [_m, _rI, _rT],
210
+ [0, 0, 0], 3
211
+ ];
212
+ n0_registry.registerError(ConflictException$, ConflictException);
171
213
  export var EngineNotSupportedException$ = [-3, n0, _ENSE,
172
214
  { [_e]: _c, [_hE]: 400 },
173
215
  [_m],
@@ -336,6 +378,7 @@ export const errorTypeRegistries = [
336
378
  ];
337
379
  var AudioStream = [0, n0, _AS, { [_st]: 1 }, 42];
338
380
  var LexiconContent = [0, n0, _LC, 8, 0];
381
+ var RecordingBytes = [0, n0, _RB, 8, 21];
339
382
  export var AudioEvent$ = [3, n0, _AE,
340
383
  0,
341
384
  [_AC],
@@ -346,6 +389,21 @@ export var CloseStreamEvent$ = [3, n0, _CSE,
346
389
  [],
347
390
  []
348
391
  ];
392
+ export var CreateVoiceInput$ = [3, n0, _CVI,
393
+ 0,
394
+ [_N, _LCa, _TA, _VCD, _CME, _T, _CT],
395
+ [0, 0, 2, [() => VoiceCreationData$, 0], () => CustomerManagedEncryption$, 128 | 0, [0, 4]], 4
396
+ ];
397
+ export var CreateVoiceOutput$ = [3, n0, _CVO,
398
+ 0,
399
+ [_V],
400
+ [[() => Voice$, 0]]
401
+ ];
402
+ export var CustomerManagedEncryption$ = [3, n0, _CME,
403
+ 0,
404
+ [_KKA, _EC],
405
+ [0, 128 | 0], 1
406
+ ];
349
407
  export var DeleteLexiconInput$ = [3, n0, _DLI,
350
408
  0,
351
409
  [_N],
@@ -356,15 +414,25 @@ export var DeleteLexiconOutput$ = [3, n0, _DLO,
356
414
  [],
357
415
  []
358
416
  ];
359
- export var DescribeVoicesInput$ = [3, n0, _DVI,
417
+ export var DeleteVoiceInput$ = [3, n0, _DVI,
418
+ 0,
419
+ [_VI],
420
+ [[0, 1]], 1
421
+ ];
422
+ export var DeleteVoiceOutput$ = [3, n0, _DVO,
423
+ 0,
424
+ [],
425
+ []
426
+ ];
427
+ export var DescribeVoicesInput$ = [3, n0, _DVIe,
360
428
  0,
361
429
  [_E, _LCa, _IALC, _NT],
362
430
  [[0, { [_hQ]: _E }], [0, { [_hQ]: _LCa }], [2, { [_hQ]: _IALC }], [0, { [_hQ]: _NT }]]
363
431
  ];
364
- export var DescribeVoicesOutput$ = [3, n0, _DVO,
432
+ export var DescribeVoicesOutput$ = [3, n0, _DVOe,
365
433
  0,
366
- [_V, _NT],
367
- [() => VoiceList, 0]
434
+ [_Vo, _NT],
435
+ [[() => VoiceList, 0], 0]
368
436
  ];
369
437
  export var FlushStreamConfiguration$ = [3, n0, _FSC,
370
438
  0,
@@ -391,6 +459,16 @@ export var GetSpeechSynthesisTaskOutput$ = [3, n0, _GSSTO,
391
459
  [_ST],
392
460
  [() => SynthesisTask$]
393
461
  ];
462
+ export var GetVoiceInput$ = [3, n0, _GVI,
463
+ 0,
464
+ [_VI],
465
+ [[0, 1]], 1
466
+ ];
467
+ export var GetVoiceOutput$ = [3, n0, _GVO,
468
+ 0,
469
+ [_V],
470
+ [[() => Voice$, 0]]
471
+ ];
394
472
  export var Lexicon$ = [3, n0, _L,
395
473
  0,
396
474
  [_C, _N],
@@ -446,6 +524,16 @@ export var PutLexiconOutput$ = [3, n0, _PLO,
446
524
  [],
447
525
  []
448
526
  ];
527
+ export var Recording$ = [3, n0, _R,
528
+ 0,
529
+ [_Fo, _D],
530
+ [0, [() => RecordingData$, 0]], 2
531
+ ];
532
+ export var RecordingData$ = [3, n0, _RD,
533
+ 0,
534
+ [_SU, _B],
535
+ [0, [() => RecordingBytes, 0]]
536
+ ];
449
537
  export var StartSpeechSynthesisStreamInput$ = [3, n0, _SSSSI,
450
538
  0,
451
539
  [_E, _OF, _VI, _LCa, _LN, _SR, _ASc],
@@ -473,7 +561,7 @@ export var StreamClosedEvent$ = [3, n0, _SCE,
473
561
  ];
474
562
  export var SynthesisTask$ = [3, n0, _ST,
475
563
  0,
476
- [_E, _TI, _TS, _TSR, _OU, _CT, _RC, _STA, _LN, _OF, _SR, _SMT, _TT, _VI, _LCa],
564
+ [_E, _TI, _TS, _TSR, _OU, _CTr, _RC, _STA, _LN, _OF, _SR, _SMT, _TT, _VI, _LCa],
477
565
  [0, 0, 0, 0, 0, 4, 1, 0, 64 | 0, 0, 0, 64 | 0, 0, 0, 0]
478
566
  ];
479
567
  export var SynthesizeSpeechInput$ = [3, n0, _SSI,
@@ -521,10 +609,15 @@ export var ValidationExceptionField$ = [3, n0, _VEF,
521
609
  [_n, _m],
522
610
  [0, 0], 2
523
611
  ];
524
- export var Voice$ = [3, n0, _Vo,
612
+ export var Voice$ = [3, n0, _V,
613
+ 0,
614
+ [_Ar, _G, _I, _LCa, _LNa, _N, _O, _St, _SRt, _ALC, _SE, _VCD, _CME, _CTr],
615
+ [0, 0, 0, 0, 0, 0, 0, 0, 0, 64 | 0, 64 | 0, [() => VoiceCreationData$, 0], () => CustomerManagedEncryption$, 4]
616
+ ];
617
+ export var VoiceCreationData$ = [3, n0, _VCD,
525
618
  0,
526
- [_G, _I, _LCa, _LNa, _N, _ALC, _SE],
527
- [0, 0, 0, 0, 0, 64 | 0, 64 | 0]
619
+ [_Re],
620
+ [[() => RecordingList, 0]], 1
528
621
  ];
529
622
  var EngineList = 64 | 0;
530
623
  var LanguageCodeList = 64 | 0;
@@ -532,6 +625,10 @@ var LexiconDescriptionList = [1, n0, _LDL,
532
625
  0, () => LexiconDescription$
533
626
  ];
534
627
  var LexiconNameList = 64 | 0;
628
+ var RecordingList = [1, n0, _RL,
629
+ 0, [() => Recording$,
630
+ 0]
631
+ ];
535
632
  var SpeechMarkTypeList = 64 | 0;
536
633
  var SynthesisTasks = [1, n0, _STy,
537
634
  0, () => SynthesisTask$
@@ -544,8 +641,10 @@ var ValidationExceptionFieldList = [1, n0, _VEFL,
544
641
  0, () => ValidationExceptionField$
545
642
  ];
546
643
  var VoiceList = [1, n0, _VL,
547
- 0, () => Voice$
644
+ 0, [() => Voice$,
645
+ 0]
548
646
  ];
647
+ var EncryptionContext = 128 | 0;
549
648
  var TagMap = 128 | 0;
550
649
  export var StartSpeechSynthesisStreamActionStream$ = [4, n0, _SSSSAS,
551
650
  { [_st]: 1 },
@@ -557,10 +656,16 @@ export var StartSpeechSynthesisStreamEventStream$ = [4, n0, _SSSSES,
557
656
  [_AE, _SCE, _VE, _SQEE, _SFE, _TE],
558
657
  [[() => AudioEvent$, 0], () => StreamClosedEvent$, [() => ValidationException$, 0], [() => ServiceQuotaExceededException$, 0], [() => ServiceFailureException$, 0], [() => ThrottlingException$, 0]]
559
658
  ];
659
+ export var CreateVoice$ = [9, n0, _CV,
660
+ { [_h]: ["POST", "/v1/voices", 200] }, () => CreateVoiceInput$, () => CreateVoiceOutput$
661
+ ];
560
662
  export var DeleteLexicon$ = [9, n0, _DL,
561
663
  { [_h]: ["DELETE", "/v1/lexicons/{Name}", 200] }, () => DeleteLexiconInput$, () => DeleteLexiconOutput$
562
664
  ];
563
- export var DescribeVoices$ = [9, n0, _DV,
665
+ export var DeleteVoice$ = [9, n0, _DV,
666
+ { [_h]: ["DELETE", "/v1/voices/{VoiceId}", 200] }, () => DeleteVoiceInput$, () => DeleteVoiceOutput$
667
+ ];
668
+ export var DescribeVoices$ = [9, n0, _DVe,
564
669
  { [_h]: ["GET", "/v1/voices", 200] }, () => DescribeVoicesInput$, () => DescribeVoicesOutput$
565
670
  ];
566
671
  export var GetLexicon$ = [9, n0, _GL,
@@ -569,6 +674,9 @@ export var GetLexicon$ = [9, n0, _GL,
569
674
  export var GetSpeechSynthesisTask$ = [9, n0, _GSST,
570
675
  { [_h]: ["GET", "/v1/synthesisTasks/{TaskId}", 200] }, () => GetSpeechSynthesisTaskInput$, () => GetSpeechSynthesisTaskOutput$
571
676
  ];
677
+ export var GetVoice$ = [9, n0, _GV,
678
+ { [_h]: ["GET", "/v1/voices/{VoiceId}", 200] }, () => GetVoiceInput$, () => GetVoiceOutput$
679
+ ];
572
680
  export var ListLexicons$ = [9, n0, _LL,
573
681
  { [_h]: ["GET", "/v1/lexicons", 200] }, () => ListLexiconsInput$, () => ListLexiconsOutput$
574
682
  ];
@@ -0,0 +1 @@
1
+ export * from "./waitForVoiceActive";
@@ -0,0 +1,40 @@
1
+ import { checkExceptions, createWaiter, WaiterState, } from "@smithy/core/client";
2
+ import { GetVoiceCommand } from "../commands/GetVoiceCommand";
3
+ const checkState = async (client, input) => {
4
+ let reason;
5
+ try {
6
+ let result = await client.send(new GetVoiceCommand(input));
7
+ reason = result;
8
+ try {
9
+ const returnComparator = () => {
10
+ return result.Voice.Status;
11
+ };
12
+ if (returnComparator() === "active") {
13
+ return { state: WaiterState.SUCCESS, reason };
14
+ }
15
+ }
16
+ catch (e) { }
17
+ try {
18
+ const returnComparator = () => {
19
+ return result.Voice.Status;
20
+ };
21
+ if (returnComparator() === "failed") {
22
+ return { state: WaiterState.FAILURE, reason };
23
+ }
24
+ }
25
+ catch (e) { }
26
+ }
27
+ catch (exception) {
28
+ reason = exception;
29
+ }
30
+ return { state: WaiterState.RETRY, reason };
31
+ };
32
+ export const waitForVoiceActive = async (params, input) => {
33
+ const serviceDefaults = { minDelay: 15, maxDelay: 120 };
34
+ return createWaiter({ ...serviceDefaults, ...params }, input, checkState);
35
+ };
36
+ export const waitUntilVoiceActive = async (params, input) => {
37
+ const serviceDefaults = { minDelay: 15, maxDelay: 120 };
38
+ const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState);
39
+ return checkExceptions(result);
40
+ };
@@ -1,8 +1,12 @@
1
- import type { HttpHandlerOptions as __HttpHandlerOptions, MetricsRecorder as __MetricsRecorder, PaginationConfiguration, Paginator } from "@smithy/types";
1
+ import { type WaiterResult } from "@smithy/core/client";
2
+ import type { HttpHandlerOptions as __HttpHandlerOptions, MetricsRecorder as __MetricsRecorder, PaginationConfiguration, Paginator, WaiterConfiguration } from "@smithy/types";
3
+ import { type CreateVoiceCommandInput, type CreateVoiceCommandOutput } from "./commands/CreateVoiceCommand";
2
4
  import { type DeleteLexiconCommandInput, type DeleteLexiconCommandOutput } from "./commands/DeleteLexiconCommand";
5
+ import { type DeleteVoiceCommandInput, type DeleteVoiceCommandOutput } from "./commands/DeleteVoiceCommand";
3
6
  import { type DescribeVoicesCommandInput, type DescribeVoicesCommandOutput } from "./commands/DescribeVoicesCommand";
4
7
  import { type GetLexiconCommandInput, type GetLexiconCommandOutput } from "./commands/GetLexiconCommand";
5
8
  import { type GetSpeechSynthesisTaskCommandInput, type GetSpeechSynthesisTaskCommandOutput } from "./commands/GetSpeechSynthesisTaskCommand";
9
+ import { type GetVoiceCommandInput, type GetVoiceCommandOutput } from "./commands/GetVoiceCommand";
6
10
  import { type ListLexiconsCommandInput, type ListLexiconsCommandOutput } from "./commands/ListLexiconsCommand";
7
11
  import { type ListSpeechSynthesisTasksCommandInput, type ListSpeechSynthesisTasksCommandOutput } from "./commands/ListSpeechSynthesisTasksCommand";
8
12
  import { type ListTagsForResourceCommandInput, type ListTagsForResourceCommandOutput } from "./commands/ListTagsForResourceCommand";
@@ -20,12 +24,24 @@ export interface PollyRequestOptions extends __HttpHandlerOptions {
20
24
  metricsRecorder?: __MetricsRecorder<unknown>;
21
25
  }
22
26
  export interface Polly {
27
+ /**
28
+ * @see {@link CreateVoiceCommand}
29
+ */
30
+ createVoice(args: CreateVoiceCommandInput, options?: PollyRequestOptions): Promise<CreateVoiceCommandOutput>;
31
+ createVoice(args: CreateVoiceCommandInput, cb: (err: any, data?: CreateVoiceCommandOutput) => void): void;
32
+ createVoice(args: CreateVoiceCommandInput, options: PollyRequestOptions, cb: (err: any, data?: CreateVoiceCommandOutput) => void): void;
23
33
  /**
24
34
  * @see {@link DeleteLexiconCommand}
25
35
  */
26
36
  deleteLexicon(args: DeleteLexiconCommandInput, options?: PollyRequestOptions): Promise<DeleteLexiconCommandOutput>;
27
37
  deleteLexicon(args: DeleteLexiconCommandInput, cb: (err: any, data?: DeleteLexiconCommandOutput) => void): void;
28
38
  deleteLexicon(args: DeleteLexiconCommandInput, options: PollyRequestOptions, cb: (err: any, data?: DeleteLexiconCommandOutput) => void): void;
39
+ /**
40
+ * @see {@link DeleteVoiceCommand}
41
+ */
42
+ deleteVoice(args: DeleteVoiceCommandInput, options?: PollyRequestOptions): Promise<DeleteVoiceCommandOutput>;
43
+ deleteVoice(args: DeleteVoiceCommandInput, cb: (err: any, data?: DeleteVoiceCommandOutput) => void): void;
44
+ deleteVoice(args: DeleteVoiceCommandInput, options: PollyRequestOptions, cb: (err: any, data?: DeleteVoiceCommandOutput) => void): void;
29
45
  /**
30
46
  * @see {@link DescribeVoicesCommand}
31
47
  */
@@ -45,6 +61,12 @@ export interface Polly {
45
61
  getSpeechSynthesisTask(args: GetSpeechSynthesisTaskCommandInput, options?: PollyRequestOptions): Promise<GetSpeechSynthesisTaskCommandOutput>;
46
62
  getSpeechSynthesisTask(args: GetSpeechSynthesisTaskCommandInput, cb: (err: any, data?: GetSpeechSynthesisTaskCommandOutput) => void): void;
47
63
  getSpeechSynthesisTask(args: GetSpeechSynthesisTaskCommandInput, options: PollyRequestOptions, cb: (err: any, data?: GetSpeechSynthesisTaskCommandOutput) => void): void;
64
+ /**
65
+ * @see {@link GetVoiceCommand}
66
+ */
67
+ getVoice(args: GetVoiceCommandInput, options?: PollyRequestOptions): Promise<GetVoiceCommandOutput>;
68
+ getVoice(args: GetVoiceCommandInput, cb: (err: any, data?: GetVoiceCommandOutput) => void): void;
69
+ getVoice(args: GetVoiceCommandInput, options: PollyRequestOptions, cb: (err: any, data?: GetVoiceCommandOutput) => void): void;
48
70
  /**
49
71
  * @see {@link ListLexiconsCommand}
50
72
  */
@@ -108,6 +130,12 @@ export interface Polly {
108
130
  * @returns AsyncIterable of {@link ListSpeechSynthesisTasksCommandOutput}.
109
131
  */
110
132
  paginateListSpeechSynthesisTasks(args?: ListSpeechSynthesisTasksCommandInput, paginationConfig?: Omit<PaginationConfiguration, "client">): Paginator<ListSpeechSynthesisTasksCommandOutput>;
133
+ /**
134
+ * @see {@link GetVoiceCommand}
135
+ * @param args - command input.
136
+ * @param waiterConfig - `maxWaitTime` in seconds or waiter config object.
137
+ */
138
+ waitUntilVoiceActive(args: GetVoiceCommandInput, waiterConfig: number | Omit<WaiterConfiguration<Polly>, "client">): Promise<WaiterResult<GetVoiceCommandOutput>>;
111
139
  }
112
140
  /**
113
141
  * <p>Amazon Polly is a web service that makes it easy to synthesize speech from
@@ -9,10 +9,13 @@ import { type HttpHandlerUserInput as __HttpHandlerUserInput } from "@smithy/cor
9
9
  import { type RetryInputConfig, type RetryResolvedConfig } from "@smithy/core/retry";
10
10
  import type { AwsCredentialIdentityProvider, BodyLengthCalculator as __BodyLengthCalculator, CheckOptionalClientConfig as __CheckOptionalClientConfig, ChecksumConstructor as __ChecksumConstructor, Decoder as __Decoder, Encoder as __Encoder, EventStreamSerdeProvider as __EventStreamSerdeProvider, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, SdkStreamMixinInjector as __SdkStreamMixinInjector, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@smithy/types";
11
11
  import { type HttpAuthSchemeInputConfig, type HttpAuthSchemeResolvedConfig } from "./auth/httpAuthSchemeProvider";
12
+ import type { CreateVoiceCommandInput, CreateVoiceCommandOutput } from "./commands/CreateVoiceCommand";
12
13
  import type { DeleteLexiconCommandInput, DeleteLexiconCommandOutput } from "./commands/DeleteLexiconCommand";
14
+ import type { DeleteVoiceCommandInput, DeleteVoiceCommandOutput } from "./commands/DeleteVoiceCommand";
13
15
  import type { DescribeVoicesCommandInput, DescribeVoicesCommandOutput } from "./commands/DescribeVoicesCommand";
14
16
  import type { GetLexiconCommandInput, GetLexiconCommandOutput } from "./commands/GetLexiconCommand";
15
17
  import type { GetSpeechSynthesisTaskCommandInput, GetSpeechSynthesisTaskCommandOutput } from "./commands/GetSpeechSynthesisTaskCommand";
18
+ import type { GetVoiceCommandInput, GetVoiceCommandOutput } from "./commands/GetVoiceCommand";
16
19
  import type { ListLexiconsCommandInput, ListLexiconsCommandOutput } from "./commands/ListLexiconsCommand";
17
20
  import type { ListSpeechSynthesisTasksCommandInput, ListSpeechSynthesisTasksCommandOutput } from "./commands/ListSpeechSynthesisTasksCommand";
18
21
  import type { ListTagsForResourceCommandInput, ListTagsForResourceCommandOutput } from "./commands/ListTagsForResourceCommand";
@@ -28,11 +31,11 @@ export { __Client };
28
31
  /**
29
32
  * @public
30
33
  */
31
- export type ServiceInputTypes = DeleteLexiconCommandInput | DescribeVoicesCommandInput | GetLexiconCommandInput | GetSpeechSynthesisTaskCommandInput | ListLexiconsCommandInput | ListSpeechSynthesisTasksCommandInput | ListTagsForResourceCommandInput | PutLexiconCommandInput | StartSpeechSynthesisStreamCommandInput | StartSpeechSynthesisTaskCommandInput | SynthesizeSpeechCommandInput | TagResourceCommandInput | UntagResourceCommandInput;
34
+ export type ServiceInputTypes = CreateVoiceCommandInput | DeleteLexiconCommandInput | DeleteVoiceCommandInput | DescribeVoicesCommandInput | GetLexiconCommandInput | GetSpeechSynthesisTaskCommandInput | GetVoiceCommandInput | ListLexiconsCommandInput | ListSpeechSynthesisTasksCommandInput | ListTagsForResourceCommandInput | PutLexiconCommandInput | StartSpeechSynthesisStreamCommandInput | StartSpeechSynthesisTaskCommandInput | SynthesizeSpeechCommandInput | TagResourceCommandInput | UntagResourceCommandInput;
32
35
  /**
33
36
  * @public
34
37
  */
35
- export type ServiceOutputTypes = DeleteLexiconCommandOutput | DescribeVoicesCommandOutput | GetLexiconCommandOutput | GetSpeechSynthesisTaskCommandOutput | ListLexiconsCommandOutput | ListSpeechSynthesisTasksCommandOutput | ListTagsForResourceCommandOutput | PutLexiconCommandOutput | StartSpeechSynthesisStreamCommandOutput | StartSpeechSynthesisTaskCommandOutput | SynthesizeSpeechCommandOutput | TagResourceCommandOutput | UntagResourceCommandOutput;
38
+ export type ServiceOutputTypes = CreateVoiceCommandOutput | DeleteLexiconCommandOutput | DeleteVoiceCommandOutput | DescribeVoicesCommandOutput | GetLexiconCommandOutput | GetSpeechSynthesisTaskCommandOutput | GetVoiceCommandOutput | ListLexiconsCommandOutput | ListSpeechSynthesisTasksCommandOutput | ListTagsForResourceCommandOutput | PutLexiconCommandOutput | StartSpeechSynthesisStreamCommandOutput | StartSpeechSynthesisTaskCommandOutput | SynthesizeSpeechCommandOutput | TagResourceCommandOutput | UntagResourceCommandOutput;
36
39
  /**
37
40
  * @public
38
41
  */
@@ -0,0 +1,174 @@
1
+ import type { MetadataBearer as __MetadataBearer } from "@smithy/types";
2
+ import type { CreateVoiceInput, CreateVoiceOutput } from "../models/models_0";
3
+ /**
4
+ * @public
5
+ */
6
+ export type { __MetadataBearer };
7
+ /**
8
+ * @public
9
+ *
10
+ * The input for {@link CreateVoiceCommand}.
11
+ */
12
+ export interface CreateVoiceCommandInput extends CreateVoiceInput {
13
+ }
14
+ /**
15
+ * @public
16
+ *
17
+ * The output of {@link CreateVoiceCommand}.
18
+ */
19
+ export interface CreateVoiceCommandOutput extends CreateVoiceOutput, __MetadataBearer {
20
+ }
21
+ declare const CreateVoiceCommand_base: {
22
+ new (input: CreateVoiceCommandInput): import("@smithy/core/client").CommandImpl<CreateVoiceCommandInput, CreateVoiceCommandOutput, import("..").PollyClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
23
+ new (input: CreateVoiceCommandInput): import("@smithy/core/client").CommandImpl<CreateVoiceCommandInput, CreateVoiceCommandOutput, import("..").PollyClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
24
+ getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
25
+ };
26
+ /**
27
+ * <p>Creates a custom voice from recordings of a speaker and returns it
28
+ * in <code>pending</code> status. Use <code>GetVoice</code> to check the
29
+ * status. When the status is <code>active</code>, you can use the voice ID
30
+ * in <code>SynthesizeSpeech</code>, <code>StartSpeechSynthesisTask</code>,
31
+ * and <code>StartSpeechSynthesisStream</code>.</p>
32
+ * <p>The <code>custom-voice-max-count</code> service quota limits the
33
+ * number of custom voices in your account in each Region. If you reach the
34
+ * quota, the request fails with
35
+ * <code>ServiceQuotaExceededException</code>.</p>
36
+ * <p>This operation requires permissions to perform the
37
+ * <code>polly:CreateVoice</code> action. You also need
38
+ * <code>s3:GetObject</code> permission on each recording that you specify by
39
+ * <code>S3Url</code>. If you specify a customer managed key, you also need
40
+ * <code>kms:DescribeKey</code>, <code>kms:GenerateDataKey</code>, and
41
+ * <code>kms:Decrypt</code> permissions on the key. If you specify
42
+ * <code>Tags</code>, you also need the <code>polly:TagResource</code>
43
+ * permission.</p>
44
+ * @example
45
+ * Use a bare-bones client and the command you need to make an API call.
46
+ * ```javascript
47
+ * import { PollyClient, CreateVoiceCommand } from "@aws-sdk/client-polly"; // ES Modules import
48
+ * // const { PollyClient, CreateVoiceCommand } = require("@aws-sdk/client-polly"); // CommonJS import
49
+ * // import type { PollyClientConfig } from "@aws-sdk/client-polly";
50
+ * const config = {}; // type is PollyClientConfig
51
+ * const client = new PollyClient(config);
52
+ * const input = { // CreateVoiceInput
53
+ * Name: "STRING_VALUE", // required
54
+ * LanguageCode: "de-DE" || "en-US" || "es-US" || "fr-FR" || "hi-IN" || "it-IT" || "pt-BR", // required
55
+ * TermsAccepted: true || false, // required
56
+ * VoiceCreationData: { // VoiceCreationData
57
+ * Recordings: [ // RecordingList // required
58
+ * { // Recording
59
+ * Format: "wav" || "flac" || "ogg_vorbis" || "mp3", // required
60
+ * Data: { // RecordingData
61
+ * S3Url: "STRING_VALUE",
62
+ * Bytes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
63
+ * },
64
+ * },
65
+ * ],
66
+ * },
67
+ * CustomerManagedEncryption: { // CustomerManagedEncryption
68
+ * KmsKeyArn: "STRING_VALUE", // required
69
+ * EncryptionContext: { // EncryptionContext
70
+ * "<keys>": "STRING_VALUE",
71
+ * },
72
+ * },
73
+ * Tags: { // TagMap
74
+ * "<keys>": "STRING_VALUE",
75
+ * },
76
+ * ClientToken: "STRING_VALUE",
77
+ * };
78
+ * const command = new CreateVoiceCommand(input);
79
+ * const response = await client.send(command);
80
+ * // { // CreateVoiceOutput
81
+ * // Voice: { // Voice
82
+ * // Arn: "STRING_VALUE",
83
+ * // Gender: "Female" || "Male",
84
+ * // Id: "Aditi" || "Amy" || "Astrid" || "Bianca" || "Brian" || "Camila" || "Carla" || "Carmen" || "Celine" || "Chantal" || "Conchita" || "Cristiano" || "Dora" || "Emma" || "Enrique" || "Ewa" || "Filiz" || "Gabrielle" || "Geraint" || "Giorgio" || "Gwyneth" || "Hans" || "Ines" || "Ivy" || "Jacek" || "Jan" || "Joanna" || "Joey" || "Justin" || "Karl" || "Kendra" || "Kevin" || "Kimberly" || "Lea" || "Liv" || "Lotte" || "Lucia" || "Lupe" || "Mads" || "Maja" || "Marlene" || "Mathieu" || "Matthew" || "Maxim" || "Mia" || "Miguel" || "Mizuki" || "Naja" || "Nicole" || "Olivia" || "Penelope" || "Raveena" || "Ricardo" || "Ruben" || "Russell" || "Salli" || "Seoyeon" || "Takumi" || "Tatyana" || "Vicki" || "Vitoria" || "Zeina" || "Zhiyu" || "Aria" || "Ayanda" || "Arlet" || "Hannah" || "Arthur" || "Daniel" || "Liam" || "Pedro" || "Kajal" || "Hiujin" || "Laura" || "Elin" || "Ida" || "Suvi" || "Ola" || "Hala" || "Andres" || "Sergio" || "Remi" || "Adriano" || "Thiago" || "Ruth" || "Stephen" || "Kazuha" || "Tomoko" || "Niamh" || "Sofie" || "Lisa" || "Isabelle" || "Zayd" || "Danielle" || "Gregory" || "Burcu" || "Jitka" || "Sabrina" || "Jasmine" || "Jihye" || "Ambre" || "Beatrice" || "Florian" || "Lennart" || "Lorenzo" || "Tiffany" || "Arjun" || "Carlos" || "Carolina" || "Curtis" || "Hyunduk" || "Kenneth" || "Kiara" || "Leo" || "Nate" || "Tina",
85
+ * // LanguageCode: "arb" || "cmn-CN" || "cy-GB" || "da-DK" || "de-DE" || "en-AU" || "en-GB" || "en-GB-WLS" || "en-IN" || "en-US" || "es-ES" || "es-MX" || "es-US" || "fr-CA" || "fr-FR" || "is-IS" || "it-IT" || "ja-JP" || "hi-IN" || "ko-KR" || "nb-NO" || "nl-NL" || "pl-PL" || "pt-BR" || "pt-PT" || "ro-RO" || "ru-RU" || "sv-SE" || "tr-TR" || "en-NZ" || "en-ZA" || "ca-ES" || "de-AT" || "yue-CN" || "ar-AE" || "fi-FI" || "en-IE" || "nl-BE" || "fr-BE" || "cs-CZ" || "de-CH" || "en-SG",
86
+ * // LanguageName: "STRING_VALUE",
87
+ * // Name: "STRING_VALUE",
88
+ * // Origin: "aws" || "customer",
89
+ * // Status: "pending" || "active" || "failed",
90
+ * // StatusReason: "STRING_VALUE",
91
+ * // AdditionalLanguageCodes: [ // LanguageCodeList
92
+ * // "arb" || "cmn-CN" || "cy-GB" || "da-DK" || "de-DE" || "en-AU" || "en-GB" || "en-GB-WLS" || "en-IN" || "en-US" || "es-ES" || "es-MX" || "es-US" || "fr-CA" || "fr-FR" || "is-IS" || "it-IT" || "ja-JP" || "hi-IN" || "ko-KR" || "nb-NO" || "nl-NL" || "pl-PL" || "pt-BR" || "pt-PT" || "ro-RO" || "ru-RU" || "sv-SE" || "tr-TR" || "en-NZ" || "en-ZA" || "ca-ES" || "de-AT" || "yue-CN" || "ar-AE" || "fi-FI" || "en-IE" || "nl-BE" || "fr-BE" || "cs-CZ" || "de-CH" || "en-SG",
93
+ * // ],
94
+ * // SupportedEngines: [ // EngineList
95
+ * // "standard" || "neural" || "long-form" || "generative",
96
+ * // ],
97
+ * // VoiceCreationData: { // VoiceCreationData
98
+ * // Recordings: [ // RecordingList // required
99
+ * // { // Recording
100
+ * // Format: "wav" || "flac" || "ogg_vorbis" || "mp3", // required
101
+ * // Data: { // RecordingData
102
+ * // S3Url: "STRING_VALUE",
103
+ * // Bytes: new Uint8Array(),
104
+ * // },
105
+ * // },
106
+ * // ],
107
+ * // },
108
+ * // CustomerManagedEncryption: { // CustomerManagedEncryption
109
+ * // KmsKeyArn: "STRING_VALUE", // required
110
+ * // EncryptionContext: { // EncryptionContext
111
+ * // "<keys>": "STRING_VALUE",
112
+ * // },
113
+ * // },
114
+ * // CreationTime: new Date("TIMESTAMP"),
115
+ * // },
116
+ * // };
117
+ *
118
+ * ```
119
+ *
120
+ * @param CreateVoiceCommandInput - {@link CreateVoiceCommandInput}
121
+ * @returns {@link CreateVoiceCommandOutput}
122
+ * @see {@link CreateVoiceCommandInput} for command's `input` shape.
123
+ * @see {@link CreateVoiceCommandOutput} for command's `response` shape.
124
+ * @see {@link PollyClientResolvedConfig | config} for PollyClient's `config` shape.
125
+ *
126
+ * @throws {@link AccessDeniedException} (client fault)
127
+ * <p>You don't have sufficient permissions to perform this action. For a
128
+ * custom voice that uses a customer managed key, Amazon Polly also returns this
129
+ * exception if you don't have the required Amazon Web Services KMS permissions on the
130
+ * key.</p>
131
+ *
132
+ * @throws {@link InvalidTagParameterException} (client fault)
133
+ * <p>The resource ARN or a tag in the request isn't valid. Specify the ARN
134
+ * of a supported resource in the Amazon Web Services account and Region of the request.
135
+ * Tag keys can have a maximum length of 128 characters, and tag values can
136
+ * have a maximum length of 256 characters. Correct the ARN or the tags, and
137
+ * then try again.</p>
138
+ *
139
+ * @throws {@link ServiceFailureException} (server fault)
140
+ * <p>An unknown condition has caused a service failure.</p>
141
+ *
142
+ * @throws {@link ServiceQuotaExceededException} (client fault)
143
+ * <p>The request would cause a service quota to be exceeded.</p>
144
+ *
145
+ * @throws {@link ThrottlingException} (client fault)
146
+ * <p>The request was denied because of request throttling.</p>
147
+ *
148
+ * @throws {@link TooManyTagsException} (client fault)
149
+ * <p>The list of tags on the resource is over the limit. The maximum number
150
+ * of tags that can be applied to a resource is 50. Remove unused tags or
151
+ * reduce the number of tags in the request, and then try again.</p>
152
+ *
153
+ * @throws {@link ValidationException} (client fault)
154
+ * <p>The input fails to satisfy the constraints specified by the service.</p>
155
+ *
156
+ * @throws {@link PollyServiceException}
157
+ * <p>Base exception class for all service exceptions from Polly service.</p>
158
+ *
159
+ *
160
+ * @public
161
+ */
162
+ export declare class CreateVoiceCommand extends CreateVoiceCommand_base {
163
+ /** @internal type navigation helper, not in runtime. */
164
+ protected static __types: {
165
+ api: {
166
+ input: CreateVoiceInput;
167
+ output: CreateVoiceOutput;
168
+ };
169
+ sdk: {
170
+ input: CreateVoiceCommandInput;
171
+ output: CreateVoiceCommandOutput;
172
+ };
173
+ };
174
+ }