/* * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.polly.model; import java.io.Serializable; import com.amazonaws.AmazonWebServiceRequest; /** *

* Returns the list of voices that are available for use when requesting speech * synthesis. Each voice speaks a specified language, is either male or female, * and is identified by an ID, which is the ASCII version of the voice name. *

*

* When synthesizing speech ( SynthesizeSpeech ), you provide the * voice ID for the voice you want from the list of voices returned by * DescribeVoices. *

*

* For example, you want your news reader application to read news in a specific * language, but giving a user the option to choose the voice. Using the * DescribeVoices operation you can provide the user with a list of * available voices to select from. *

*

* You can optionally specify a language code to filter the available voices. * For example, if you specify en-US, the operation returns a list * of all available US English voices. *

*

* This operation requires permissions to perform the * polly:DescribeVoices action. *

*/ public class DescribeVoicesRequest extends AmazonWebServiceRequest implements Serializable { /** *

* Specifies the engine (standard or neural) used * by Amazon Polly when processing input text for speech synthesis. *

*

* Constraints:
* Allowed Values: standard, neural */ private String engine; /** *

* The language identification tag (ISO 639 code for the language name-ISO * 3166 country code) for filtering the list of voices returned. If you * don't specify this optional parameter, all available voices are returned. *

*

* Constraints:
* Allowed Values: 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 */ private String languageCode; /** *

* Boolean value indicating whether to return any bilingual voices that use * the specified language as an additional language. For instance, if you * request all languages that use US English (es-US), and there is an * Italian voice that speaks both Italian (it-IT) and US English, that voice * will be included if you specify yes but not if you specify * no. *

*/ private Boolean includeAdditionalLanguageCodes; /** *

* An opaque pagination token returned from the previous * DescribeVoices operation. If present, this indicates where * to continue the listing. *

*

* Constraints:
* Length: 0 - 4096
*/ private String nextToken; /** *

* Specifies the engine (standard or neural) used * by Amazon Polly when processing input text for speech synthesis. *

*

* Constraints:
* Allowed Values: standard, neural * * @return

* Specifies the engine (standard or * neural) used by Amazon Polly when processing input * text for speech synthesis. *

* @see Engine */ public String getEngine() { return engine; } /** *

* Specifies the engine (standard or neural) used * by Amazon Polly when processing input text for speech synthesis. *

*

* Constraints:
* Allowed Values: standard, neural * * @param engine

* Specifies the engine (standard or * neural) used by Amazon Polly when processing * input text for speech synthesis. *

* @see Engine */ public void setEngine(String engine) { this.engine = engine; } /** *

* Specifies the engine (standard or neural) used * by Amazon Polly when processing input text for speech synthesis. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: standard, neural * * @param engine

* Specifies the engine (standard or * neural) used by Amazon Polly when processing * input text for speech synthesis. *

* @return A reference to this updated object so that method calls can be * chained together. * @see Engine */ public DescribeVoicesRequest withEngine(String engine) { this.engine = engine; return this; } /** *

* Specifies the engine (standard or neural) used * by Amazon Polly when processing input text for speech synthesis. *

*

* Constraints:
* Allowed Values: standard, neural * * @param engine

* Specifies the engine (standard or * neural) used by Amazon Polly when processing * input text for speech synthesis. *

* @see Engine */ public void setEngine(Engine engine) { this.engine = engine.toString(); } /** *

* Specifies the engine (standard or neural) used * by Amazon Polly when processing input text for speech synthesis. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: standard, neural * * @param engine

* Specifies the engine (standard or * neural) used by Amazon Polly when processing * input text for speech synthesis. *

* @return A reference to this updated object so that method calls can be * chained together. * @see Engine */ public DescribeVoicesRequest withEngine(Engine engine) { this.engine = engine.toString(); return this; } /** *

* The language identification tag (ISO 639 code for the language name-ISO * 3166 country code) for filtering the list of voices returned. If you * don't specify this optional parameter, all available voices are returned. *

*

* Constraints:
* Allowed Values: 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 * * @return

* The language identification tag (ISO 639 code for the language * name-ISO 3166 country code) for filtering the list of voices * returned. If you don't specify this optional parameter, all * available voices are returned. *

* @see LanguageCode */ public String getLanguageCode() { return languageCode; } /** *

* The language identification tag (ISO 639 code for the language name-ISO * 3166 country code) for filtering the list of voices returned. If you * don't specify this optional parameter, all available voices are returned. *

*

* Constraints:
* Allowed Values: 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 * * @param languageCode

* The language identification tag (ISO 639 code for the language * name-ISO 3166 country code) for filtering the list of voices * returned. If you don't specify this optional parameter, all * available voices are returned. *

* @see LanguageCode */ public void setLanguageCode(String languageCode) { this.languageCode = languageCode; } /** *

* The language identification tag (ISO 639 code for the language name-ISO * 3166 country code) for filtering the list of voices returned. If you * don't specify this optional parameter, all available voices are returned. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: 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 * * @param languageCode

* The language identification tag (ISO 639 code for the language * name-ISO 3166 country code) for filtering the list of voices * returned. If you don't specify this optional parameter, all * available voices are returned. *

* @return A reference to this updated object so that method calls can be * chained together. * @see LanguageCode */ public DescribeVoicesRequest withLanguageCode(String languageCode) { this.languageCode = languageCode; return this; } /** *

* The language identification tag (ISO 639 code for the language name-ISO * 3166 country code) for filtering the list of voices returned. If you * don't specify this optional parameter, all available voices are returned. *

*

* Constraints:
* Allowed Values: 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 * * @param languageCode

* The language identification tag (ISO 639 code for the language * name-ISO 3166 country code) for filtering the list of voices * returned. If you don't specify this optional parameter, all * available voices are returned. *

* @see LanguageCode */ public void setLanguageCode(LanguageCode languageCode) { this.languageCode = languageCode.toString(); } /** *

* The language identification tag (ISO 639 code for the language name-ISO * 3166 country code) for filtering the list of voices returned. If you * don't specify this optional parameter, all available voices are returned. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: 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 * * @param languageCode

* The language identification tag (ISO 639 code for the language * name-ISO 3166 country code) for filtering the list of voices * returned. If you don't specify this optional parameter, all * available voices are returned. *

* @return A reference to this updated object so that method calls can be * chained together. * @see LanguageCode */ public DescribeVoicesRequest withLanguageCode(LanguageCode languageCode) { this.languageCode = languageCode.toString(); return this; } /** *

* Boolean value indicating whether to return any bilingual voices that use * the specified language as an additional language. For instance, if you * request all languages that use US English (es-US), and there is an * Italian voice that speaks both Italian (it-IT) and US English, that voice * will be included if you specify yes but not if you specify * no. *

* * @return

* Boolean value indicating whether to return any bilingual voices * that use the specified language as an additional language. For * instance, if you request all languages that use US English * (es-US), and there is an Italian voice that speaks both Italian * (it-IT) and US English, that voice will be included if you * specify yes but not if you specify no. *

*/ public Boolean isIncludeAdditionalLanguageCodes() { return includeAdditionalLanguageCodes; } /** *

* Boolean value indicating whether to return any bilingual voices that use * the specified language as an additional language. For instance, if you * request all languages that use US English (es-US), and there is an * Italian voice that speaks both Italian (it-IT) and US English, that voice * will be included if you specify yes but not if you specify * no. *

* * @return

* Boolean value indicating whether to return any bilingual voices * that use the specified language as an additional language. For * instance, if you request all languages that use US English * (es-US), and there is an Italian voice that speaks both Italian * (it-IT) and US English, that voice will be included if you * specify yes but not if you specify no. *

*/ public Boolean getIncludeAdditionalLanguageCodes() { return includeAdditionalLanguageCodes; } /** *

* Boolean value indicating whether to return any bilingual voices that use * the specified language as an additional language. For instance, if you * request all languages that use US English (es-US), and there is an * Italian voice that speaks both Italian (it-IT) and US English, that voice * will be included if you specify yes but not if you specify * no. *

* * @param includeAdditionalLanguageCodes

* Boolean value indicating whether to return any bilingual * voices that use the specified language as an additional * language. For instance, if you request all languages that use * US English (es-US), and there is an Italian voice that speaks * both Italian (it-IT) and US English, that voice will be * included if you specify yes but not if you * specify no. *

*/ public void setIncludeAdditionalLanguageCodes(Boolean includeAdditionalLanguageCodes) { this.includeAdditionalLanguageCodes = includeAdditionalLanguageCodes; } /** *

* Boolean value indicating whether to return any bilingual voices that use * the specified language as an additional language. For instance, if you * request all languages that use US English (es-US), and there is an * Italian voice that speaks both Italian (it-IT) and US English, that voice * will be included if you specify yes but not if you specify * no. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param includeAdditionalLanguageCodes

* Boolean value indicating whether to return any bilingual * voices that use the specified language as an additional * language. For instance, if you request all languages that use * US English (es-US), and there is an Italian voice that speaks * both Italian (it-IT) and US English, that voice will be * included if you specify yes but not if you * specify no. *

* @return A reference to this updated object so that method calls can be * chained together. */ public DescribeVoicesRequest withIncludeAdditionalLanguageCodes( Boolean includeAdditionalLanguageCodes) { this.includeAdditionalLanguageCodes = includeAdditionalLanguageCodes; return this; } /** *

* An opaque pagination token returned from the previous * DescribeVoices operation. If present, this indicates where * to continue the listing. *

*

* Constraints:
* Length: 0 - 4096
* * @return

* An opaque pagination token returned from the previous * DescribeVoices operation. If present, this indicates * where to continue the listing. *

*/ public String getNextToken() { return nextToken; } /** *

* An opaque pagination token returned from the previous * DescribeVoices operation. If present, this indicates where * to continue the listing. *

*

* Constraints:
* Length: 0 - 4096
* * @param nextToken

* An opaque pagination token returned from the previous * DescribeVoices operation. If present, this * indicates where to continue the listing. *

*/ public void setNextToken(String nextToken) { this.nextToken = nextToken; } /** *

* An opaque pagination token returned from the previous * DescribeVoices operation. If present, this indicates where * to continue the listing. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 0 - 4096
* * @param nextToken

* An opaque pagination token returned from the previous * DescribeVoices operation. If present, this * indicates where to continue the listing. *

* @return A reference to this updated object so that method calls can be * chained together. */ public DescribeVoicesRequest withNextToken(String nextToken) { this.nextToken = nextToken; return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getEngine() != null) sb.append("Engine: " + getEngine() + ","); if (getLanguageCode() != null) sb.append("LanguageCode: " + getLanguageCode() + ","); if (getIncludeAdditionalLanguageCodes() != null) sb.append("IncludeAdditionalLanguageCodes: " + getIncludeAdditionalLanguageCodes() + ","); if (getNextToken() != null) sb.append("NextToken: " + getNextToken()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getEngine() == null) ? 0 : getEngine().hashCode()); hashCode = prime * hashCode + ((getLanguageCode() == null) ? 0 : getLanguageCode().hashCode()); hashCode = prime * hashCode + ((getIncludeAdditionalLanguageCodes() == null) ? 0 : getIncludeAdditionalLanguageCodes().hashCode()); hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeVoicesRequest == false) return false; DescribeVoicesRequest other = (DescribeVoicesRequest) obj; if (other.getEngine() == null ^ this.getEngine() == null) return false; if (other.getEngine() != null && other.getEngine().equals(this.getEngine()) == false) return false; if (other.getLanguageCode() == null ^ this.getLanguageCode() == null) return false; if (other.getLanguageCode() != null && other.getLanguageCode().equals(this.getLanguageCode()) == false) return false; if (other.getIncludeAdditionalLanguageCodes() == null ^ this.getIncludeAdditionalLanguageCodes() == null) return false; if (other.getIncludeAdditionalLanguageCodes() != null && other.getIncludeAdditionalLanguageCodes().equals( this.getIncludeAdditionalLanguageCodes()) == false) return false; if (other.getNextToken() == null ^ this.getNextToken() == null) return false; if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false) return false; return true; } }