@aws-sdk/client-polly 3.312.0 → 3.316.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/dist-es/Polly.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { createAggregatedClient } from "@aws-sdk/smithy-client";
1
2
  import { DeleteLexiconCommand, } from "./commands/DeleteLexiconCommand";
2
3
  import { DescribeVoicesCommand, } from "./commands/DescribeVoicesCommand";
3
4
  import { GetLexiconCommand } from "./commands/GetLexiconCommand";
@@ -8,131 +9,17 @@ import { PutLexiconCommand } from "./commands/PutLexiconCommand";
8
9
  import { StartSpeechSynthesisTaskCommand, } from "./commands/StartSpeechSynthesisTaskCommand";
9
10
  import { SynthesizeSpeechCommand, } from "./commands/SynthesizeSpeechCommand";
10
11
  import { PollyClient } from "./PollyClient";
12
+ const commands = {
13
+ DeleteLexiconCommand,
14
+ DescribeVoicesCommand,
15
+ GetLexiconCommand,
16
+ GetSpeechSynthesisTaskCommand,
17
+ ListLexiconsCommand,
18
+ ListSpeechSynthesisTasksCommand,
19
+ PutLexiconCommand,
20
+ StartSpeechSynthesisTaskCommand,
21
+ SynthesizeSpeechCommand,
22
+ };
11
23
  export class Polly extends PollyClient {
12
- deleteLexicon(args, optionsOrCb, cb) {
13
- const command = new DeleteLexiconCommand(args);
14
- if (typeof optionsOrCb === "function") {
15
- this.send(command, optionsOrCb);
16
- }
17
- else if (typeof cb === "function") {
18
- if (typeof optionsOrCb !== "object")
19
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
20
- this.send(command, optionsOrCb || {}, cb);
21
- }
22
- else {
23
- return this.send(command, optionsOrCb);
24
- }
25
- }
26
- describeVoices(args, optionsOrCb, cb) {
27
- const command = new DescribeVoicesCommand(args);
28
- if (typeof optionsOrCb === "function") {
29
- this.send(command, optionsOrCb);
30
- }
31
- else if (typeof cb === "function") {
32
- if (typeof optionsOrCb !== "object")
33
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
34
- this.send(command, optionsOrCb || {}, cb);
35
- }
36
- else {
37
- return this.send(command, optionsOrCb);
38
- }
39
- }
40
- getLexicon(args, optionsOrCb, cb) {
41
- const command = new GetLexiconCommand(args);
42
- if (typeof optionsOrCb === "function") {
43
- this.send(command, optionsOrCb);
44
- }
45
- else if (typeof cb === "function") {
46
- if (typeof optionsOrCb !== "object")
47
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
48
- this.send(command, optionsOrCb || {}, cb);
49
- }
50
- else {
51
- return this.send(command, optionsOrCb);
52
- }
53
- }
54
- getSpeechSynthesisTask(args, optionsOrCb, cb) {
55
- const command = new GetSpeechSynthesisTaskCommand(args);
56
- if (typeof optionsOrCb === "function") {
57
- this.send(command, optionsOrCb);
58
- }
59
- else if (typeof cb === "function") {
60
- if (typeof optionsOrCb !== "object")
61
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
62
- this.send(command, optionsOrCb || {}, cb);
63
- }
64
- else {
65
- return this.send(command, optionsOrCb);
66
- }
67
- }
68
- listLexicons(args, optionsOrCb, cb) {
69
- const command = new ListLexiconsCommand(args);
70
- if (typeof optionsOrCb === "function") {
71
- this.send(command, optionsOrCb);
72
- }
73
- else if (typeof cb === "function") {
74
- if (typeof optionsOrCb !== "object")
75
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
76
- this.send(command, optionsOrCb || {}, cb);
77
- }
78
- else {
79
- return this.send(command, optionsOrCb);
80
- }
81
- }
82
- listSpeechSynthesisTasks(args, optionsOrCb, cb) {
83
- const command = new ListSpeechSynthesisTasksCommand(args);
84
- if (typeof optionsOrCb === "function") {
85
- this.send(command, optionsOrCb);
86
- }
87
- else if (typeof cb === "function") {
88
- if (typeof optionsOrCb !== "object")
89
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
90
- this.send(command, optionsOrCb || {}, cb);
91
- }
92
- else {
93
- return this.send(command, optionsOrCb);
94
- }
95
- }
96
- putLexicon(args, optionsOrCb, cb) {
97
- const command = new PutLexiconCommand(args);
98
- if (typeof optionsOrCb === "function") {
99
- this.send(command, optionsOrCb);
100
- }
101
- else if (typeof cb === "function") {
102
- if (typeof optionsOrCb !== "object")
103
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
104
- this.send(command, optionsOrCb || {}, cb);
105
- }
106
- else {
107
- return this.send(command, optionsOrCb);
108
- }
109
- }
110
- startSpeechSynthesisTask(args, optionsOrCb, cb) {
111
- const command = new StartSpeechSynthesisTaskCommand(args);
112
- if (typeof optionsOrCb === "function") {
113
- this.send(command, optionsOrCb);
114
- }
115
- else if (typeof cb === "function") {
116
- if (typeof optionsOrCb !== "object")
117
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
118
- this.send(command, optionsOrCb || {}, cb);
119
- }
120
- else {
121
- return this.send(command, optionsOrCb);
122
- }
123
- }
124
- synthesizeSpeech(args, optionsOrCb, cb) {
125
- const command = new SynthesizeSpeechCommand(args);
126
- if (typeof optionsOrCb === "function") {
127
- this.send(command, optionsOrCb);
128
- }
129
- else if (typeof cb === "function") {
130
- if (typeof optionsOrCb !== "object")
131
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
132
- this.send(command, optionsOrCb || {}, cb);
133
- }
134
- else {
135
- return this.send(command, optionsOrCb);
136
- }
137
- }
138
24
  }
25
+ createAggregatedClient(commands, Polly);