Skip to content

Commit 90e430b

Browse files
awsmobilesdkpalpatim
authored andcommitted
[aws-android-sdk-polly] Update models to latest (#1111)
1 parent df5f6b9 commit 90e430b

23 files changed

+1681
-810
lines changed

aws-android-sdk-polly/src/main/java/com/amazonaws/services/polly/AmazonPolly.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public interface AmazonPolly {
102102
* </p>
103103
* <p>
104104
* For more information, see <a href=
105-
* "http://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html"
105+
* "https://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html"
106106
* >Managing Lexicons</a>.
107107
* </p>
108108
*
@@ -170,7 +170,7 @@ DescribeVoicesResult describeVoices(DescribeVoicesRequest describeVoicesRequest)
170170
* <p>
171171
* Returns the content of the specified pronunciation lexicon stored in an
172172
* AWS Region. For more information, see <a href=
173-
* "http://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html"
173+
* "https://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html"
174174
* >Managing Lexicons</a>.
175175
* </p>
176176
*
@@ -221,7 +221,7 @@ GetSpeechSynthesisTaskResult getSpeechSynthesisTask(
221221
* <p>
222222
* Returns a list of pronunciation lexicons stored in an AWS Region. For
223223
* more information, see <a href=
224-
* "http://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html"
224+
* "https://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html"
225225
* >Managing Lexicons</a>.
226226
* </p>
227227
*
@@ -276,7 +276,7 @@ ListSpeechSynthesisTasksResult listSpeechSynthesisTasks(
276276
* </p>
277277
* <p>
278278
* For more information, see <a href=
279-
* "http://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html"
279+
* "https://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html"
280280
* >Managing Lexicons</a>.
281281
* </p>
282282
*
@@ -323,6 +323,7 @@ PutLexiconResult putLexicon(PutLexiconRequest putLexiconRequest) throws AmazonCl
323323
* @throws InvalidSampleRateException
324324
* @throws InvalidSnsTopicArnException
325325
* @throws InvalidSsmlException
326+
* @throws EngineNotSupportedException
326327
* @throws LexiconNotFoundException
327328
* @throws ServiceFailureException
328329
* @throws MarksNotSupportedForFormatException
@@ -347,7 +348,7 @@ StartSpeechSynthesisTaskResult startSpeechSynthesisTask(
347348
* available with all the voices (for example, Cyrillic might not be read at
348349
* all by English voices) unless phoneme mapping is used. For more
349350
* information, see <a href=
350-
* "http://docs.aws.amazon.com/polly/latest/dg/how-text-to-speech-works.html"
351+
* "https://docs.aws.amazon.com/polly/latest/dg/how-text-to-speech-works.html"
351352
* >How it Works</a>.
352353
* </p>
353354
*
@@ -362,6 +363,7 @@ StartSpeechSynthesisTaskResult startSpeechSynthesisTask(
362363
* @throws MarksNotSupportedForFormatException
363364
* @throws SsmlMarksNotSupportedForTextTypeException
364365
* @throws LanguageNotSupportedException
366+
* @throws EngineNotSupportedException
365367
* @throws AmazonClientException If any internal errors are encountered
366368
* inside the client while attempting to make the request or
367369
* handle the response. For example if a network connection is

aws-android-sdk-polly/src/main/java/com/amazonaws/services/polly/AmazonPollyClient.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ public AmazonPollyClient(AWSCredentialsProvider awsCredentialsProvider,
329329

330330
private void init() {
331331
jsonErrorUnmarshallers = new ArrayList<JsonErrorUnmarshaller>();
332+
jsonErrorUnmarshallers.add(new EngineNotSupportedExceptionUnmarshaller());
332333
jsonErrorUnmarshallers.add(new InvalidLexiconExceptionUnmarshaller());
333334
jsonErrorUnmarshallers.add(new InvalidNextTokenExceptionUnmarshaller());
334335
jsonErrorUnmarshallers.add(new InvalidS3BucketExceptionUnmarshaller());
@@ -377,7 +378,7 @@ private static ClientConfiguration adjustClientConfiguration(ClientConfiguration
377378
* </p>
378379
* <p>
379380
* For more information, see <a href=
380-
* "http://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html"
381+
* "https://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html"
381382
* >Managing Lexicons</a>.
382383
* </p>
383384
*
@@ -497,7 +498,7 @@ public DescribeVoicesResult describeVoices(DescribeVoicesRequest describeVoicesR
497498
* <p>
498499
* Returns the content of the specified pronunciation lexicon stored in an
499500
* AWS Region. For more information, see <a href=
500-
* "http://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html"
501+
* "https://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html"
501502
* >Managing Lexicons</a>.
502503
* </p>
503504
*
@@ -601,7 +602,7 @@ public GetSpeechSynthesisTaskResult getSpeechSynthesisTask(
601602
* <p>
602603
* Returns a list of pronunciation lexicons stored in an AWS Region. For
603604
* more information, see <a href=
604-
* "http://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html"
605+
* "https://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html"
605606
* >Managing Lexicons</a>.
606607
* </p>
607608
*
@@ -709,7 +710,7 @@ public ListSpeechSynthesisTasksResult listSpeechSynthesisTasks(
709710
* </p>
710711
* <p>
711712
* For more information, see <a href=
712-
* "http://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html"
713+
* "https://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html"
713714
* >Managing Lexicons</a>.
714715
* </p>
715716
*
@@ -782,6 +783,7 @@ public PutLexiconResult putLexicon(PutLexiconRequest putLexiconRequest)
782783
* @throws InvalidSampleRateException
783784
* @throws InvalidSnsTopicArnException
784785
* @throws InvalidSsmlException
786+
* @throws EngineNotSupportedException
785787
* @throws LexiconNotFoundException
786788
* @throws ServiceFailureException
787789
* @throws MarksNotSupportedForFormatException
@@ -833,7 +835,7 @@ public StartSpeechSynthesisTaskResult startSpeechSynthesisTask(
833835
* available with all the voices (for example, Cyrillic might not be read at
834836
* all by English voices) unless phoneme mapping is used. For more
835837
* information, see <a href=
836-
* "http://docs.aws.amazon.com/polly/latest/dg/how-text-to-speech-works.html"
838+
* "https://docs.aws.amazon.com/polly/latest/dg/how-text-to-speech-works.html"
837839
* >How it Works</a>.
838840
* </p>
839841
*
@@ -848,6 +850,7 @@ public StartSpeechSynthesisTaskResult startSpeechSynthesisTask(
848850
* @throws MarksNotSupportedForFormatException
849851
* @throws SsmlMarksNotSupportedForTextTypeException
850852
* @throws LanguageNotSupportedException
853+
* @throws EngineNotSupportedException
851854
* @throws AmazonClientException If any internal errors are encountered
852855
* inside the client while attempting to make the request or
853856
* handle the response. For example if a network connection is

aws-android-sdk-polly/src/main/java/com/amazonaws/services/polly/model/DeleteLexiconRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* </p>
2929
* <p>
3030
* For more information, see <a
31-
* href="http://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html"
31+
* href="https://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html"
3232
* >Managing Lexicons</a>.
3333
* </p>
3434
*/

aws-android-sdk-polly/src/main/java/com/amazonaws/services/polly/model/DescribeVoicesRequest.java

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,17 @@
4747
* </p>
4848
*/
4949
public class DescribeVoicesRequest extends AmazonWebServiceRequest implements Serializable {
50+
/**
51+
* <p>
52+
* Specifies the engine (<code>standard</code> or <code>neural</code>) used
53+
* by Amazon Polly when processing input text for speech synthesis.
54+
* </p>
55+
* <p>
56+
* <b>Constraints:</b><br/>
57+
* <b>Allowed Values: </b>standard, neural
58+
*/
59+
private String engine;
60+
5061
/**
5162
* <p>
5263
* The language identification tag (ISO 639 code for the language name-ISO
@@ -86,6 +97,118 @@ public class DescribeVoicesRequest extends AmazonWebServiceRequest implements Se
8697
*/
8798
private String nextToken;
8899

100+
/**
101+
* <p>
102+
* Specifies the engine (<code>standard</code> or <code>neural</code>) used
103+
* by Amazon Polly when processing input text for speech synthesis.
104+
* </p>
105+
* <p>
106+
* <b>Constraints:</b><br/>
107+
* <b>Allowed Values: </b>standard, neural
108+
*
109+
* @return <p>
110+
* Specifies the engine (<code>standard</code> or
111+
* <code>neural</code>) used by Amazon Polly when processing input
112+
* text for speech synthesis.
113+
* </p>
114+
* @see Engine
115+
*/
116+
public String getEngine() {
117+
return engine;
118+
}
119+
120+
/**
121+
* <p>
122+
* Specifies the engine (<code>standard</code> or <code>neural</code>) used
123+
* by Amazon Polly when processing input text for speech synthesis.
124+
* </p>
125+
* <p>
126+
* <b>Constraints:</b><br/>
127+
* <b>Allowed Values: </b>standard, neural
128+
*
129+
* @param engine <p>
130+
* Specifies the engine (<code>standard</code> or
131+
* <code>neural</code>) used by Amazon Polly when processing
132+
* input text for speech synthesis.
133+
* </p>
134+
* @see Engine
135+
*/
136+
public void setEngine(String engine) {
137+
this.engine = engine;
138+
}
139+
140+
/**
141+
* <p>
142+
* Specifies the engine (<code>standard</code> or <code>neural</code>) used
143+
* by Amazon Polly when processing input text for speech synthesis.
144+
* </p>
145+
* <p>
146+
* Returns a reference to this object so that method calls can be chained
147+
* together.
148+
* <p>
149+
* <b>Constraints:</b><br/>
150+
* <b>Allowed Values: </b>standard, neural
151+
*
152+
* @param engine <p>
153+
* Specifies the engine (<code>standard</code> or
154+
* <code>neural</code>) used by Amazon Polly when processing
155+
* input text for speech synthesis.
156+
* </p>
157+
* @return A reference to this updated object so that method calls can be
158+
* chained together.
159+
* @see Engine
160+
*/
161+
public DescribeVoicesRequest withEngine(String engine) {
162+
this.engine = engine;
163+
return this;
164+
}
165+
166+
/**
167+
* <p>
168+
* Specifies the engine (<code>standard</code> or <code>neural</code>) used
169+
* by Amazon Polly when processing input text for speech synthesis.
170+
* </p>
171+
* <p>
172+
* <b>Constraints:</b><br/>
173+
* <b>Allowed Values: </b>standard, neural
174+
*
175+
* @param engine <p>
176+
* Specifies the engine (<code>standard</code> or
177+
* <code>neural</code>) used by Amazon Polly when processing
178+
* input text for speech synthesis.
179+
* </p>
180+
* @see Engine
181+
*/
182+
public void setEngine(Engine engine) {
183+
this.engine = engine.toString();
184+
}
185+
186+
/**
187+
* <p>
188+
* Specifies the engine (<code>standard</code> or <code>neural</code>) used
189+
* by Amazon Polly when processing input text for speech synthesis.
190+
* </p>
191+
* <p>
192+
* Returns a reference to this object so that method calls can be chained
193+
* together.
194+
* <p>
195+
* <b>Constraints:</b><br/>
196+
* <b>Allowed Values: </b>standard, neural
197+
*
198+
* @param engine <p>
199+
* Specifies the engine (<code>standard</code> or
200+
* <code>neural</code>) used by Amazon Polly when processing
201+
* input text for speech synthesis.
202+
* </p>
203+
* @return A reference to this updated object so that method calls can be
204+
* chained together.
205+
* @see Engine
206+
*/
207+
public DescribeVoicesRequest withEngine(Engine engine) {
208+
this.engine = engine.toString();
209+
return this;
210+
}
211+
89212
/**
90213
* <p>
91214
* The language identification tag (ISO 639 code for the language name-ISO
@@ -401,6 +524,8 @@ public DescribeVoicesRequest withNextToken(String nextToken) {
401524
public String toString() {
402525
StringBuilder sb = new StringBuilder();
403526
sb.append("{");
527+
if (getEngine() != null)
528+
sb.append("Engine: " + getEngine() + ",");
404529
if (getLanguageCode() != null)
405530
sb.append("LanguageCode: " + getLanguageCode() + ",");
406531
if (getIncludeAdditionalLanguageCodes() != null)
@@ -417,6 +542,7 @@ public int hashCode() {
417542
final int prime = 31;
418543
int hashCode = 1;
419544

545+
hashCode = prime * hashCode + ((getEngine() == null) ? 0 : getEngine().hashCode());
420546
hashCode = prime * hashCode
421547
+ ((getLanguageCode() == null) ? 0 : getLanguageCode().hashCode());
422548
hashCode = prime
@@ -438,6 +564,10 @@ public boolean equals(Object obj) {
438564
return false;
439565
DescribeVoicesRequest other = (DescribeVoicesRequest) obj;
440566

567+
if (other.getEngine() == null ^ this.getEngine() == null)
568+
return false;
569+
if (other.getEngine() != null && other.getEngine().equals(this.getEngine()) == false)
570+
return false;
441571
if (other.getLanguageCode() == null ^ this.getLanguageCode() == null)
442572
return false;
443573
if (other.getLanguageCode() != null
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
package com.amazonaws.services.polly.model;
17+
18+
import java.util.HashMap;
19+
import java.util.Map;
20+
21+
/**
22+
* Engine
23+
*/
24+
public enum Engine {
25+
26+
Standard("standard"),
27+
Neural("neural");
28+
29+
private String value;
30+
31+
private Engine(String value) {
32+
this.value = value;
33+
}
34+
35+
@Override
36+
public String toString() {
37+
return value;
38+
}
39+
40+
private static final Map<String, Engine> enumMap;
41+
static {
42+
enumMap = new HashMap<String, Engine>();
43+
enumMap.put("standard", Standard);
44+
enumMap.put("neural", Neural);
45+
}
46+
47+
/**
48+
* Use this in place of valueOf.
49+
*
50+
* @param value real value
51+
* @return Engine corresponding to the value
52+
*/
53+
public static Engine fromValue(String value) {
54+
if (value == null || value.isEmpty()) {
55+
throw new IllegalArgumentException("Value cannot be null or empty!");
56+
} else if (enumMap.containsKey(value)) {
57+
return enumMap.get(value);
58+
} else {
59+
throw new IllegalArgumentException("Cannot create enum from " + value + " value!");
60+
}
61+
}
62+
}

0 commit comments

Comments
 (0)