com.amazonaws.services.polly.model.SynthesizeSpeechRequest Maven / Gradle / Ivy
/*
* Copyright 2011-2016 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;
/**
*
*/
public class SynthesizeSpeechRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* List of one or more pronunciation lexicon names you want the service to apply during synthesis. Lexicons are
* applied only if the language of the lexicon is the same as the language of the voice. For information about
* storing lexicons, see PutLexicon.
*
*/
private java.util.List lexiconNames;
/**
*
* The audio format in which the resulting stream will be encoded.
*
*/
private String outputFormat;
/**
*
* The audio frequency specified in Hz.
*
*
* The valid values for mp3
and ogg_vorbis
are "8000", "16000", and "22050". The default
* value is "22050".
*
*
* Valid values for pcm
are "8000" and "16000" The default value is "16000".
*
*/
private String sampleRate;
/**
*
* Input text to synthesize. If you specify ssml
as the TextType
, follow the SSML format
* for the input text.
*
*/
private String text;
/**
*
* Specifies whether the input text is plain text or SSML. The default value is plain text. For more information,
* see Using SSML.
*
*/
private String textType;
/**
*
* Voice ID to use for the synthesis. You can get a list of available voice IDs by calling the DescribeVoices operation.
*
*/
private String voiceId;
/**
*
* List of one or more pronunciation lexicon names you want the service to apply during synthesis. Lexicons are
* applied only if the language of the lexicon is the same as the language of the voice. For information about
* storing lexicons, see PutLexicon.
*
*
* @return List of one or more pronunciation lexicon names you want the service to apply during synthesis. Lexicons
* are applied only if the language of the lexicon is the same as the language of the voice. For information
* about storing lexicons, see PutLexicon.
*/
public java.util.List getLexiconNames() {
return lexiconNames;
}
/**
*
* List of one or more pronunciation lexicon names you want the service to apply during synthesis. Lexicons are
* applied only if the language of the lexicon is the same as the language of the voice. For information about
* storing lexicons, see PutLexicon.
*
*
* @param lexiconNames
* List of one or more pronunciation lexicon names you want the service to apply during synthesis. Lexicons
* are applied only if the language of the lexicon is the same as the language of the voice. For information
* about storing lexicons, see PutLexicon.
*/
public void setLexiconNames(java.util.Collection lexiconNames) {
if (lexiconNames == null) {
this.lexiconNames = null;
return;
}
this.lexiconNames = new java.util.ArrayList(lexiconNames);
}
/**
*
* List of one or more pronunciation lexicon names you want the service to apply during synthesis. Lexicons are
* applied only if the language of the lexicon is the same as the language of the voice. For information about
* storing lexicons, see PutLexicon.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setLexiconNames(java.util.Collection)} or {@link #withLexiconNames(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param lexiconNames
* List of one or more pronunciation lexicon names you want the service to apply during synthesis. Lexicons
* are applied only if the language of the lexicon is the same as the language of the voice. For information
* about storing lexicons, see PutLexicon.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SynthesizeSpeechRequest withLexiconNames(String... lexiconNames) {
if (this.lexiconNames == null) {
setLexiconNames(new java.util.ArrayList(lexiconNames.length));
}
for (String ele : lexiconNames) {
this.lexiconNames.add(ele);
}
return this;
}
/**
*
* List of one or more pronunciation lexicon names you want the service to apply during synthesis. Lexicons are
* applied only if the language of the lexicon is the same as the language of the voice. For information about
* storing lexicons, see PutLexicon.
*
*
* @param lexiconNames
* List of one or more pronunciation lexicon names you want the service to apply during synthesis. Lexicons
* are applied only if the language of the lexicon is the same as the language of the voice. For information
* about storing lexicons, see PutLexicon.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SynthesizeSpeechRequest withLexiconNames(java.util.Collection lexiconNames) {
setLexiconNames(lexiconNames);
return this;
}
/**
*
* The audio format in which the resulting stream will be encoded.
*
*
* @param outputFormat
* The audio format in which the resulting stream will be encoded.
* @see OutputFormat
*/
public void setOutputFormat(String outputFormat) {
this.outputFormat = outputFormat;
}
/**
*
* The audio format in which the resulting stream will be encoded.
*
*
* @return The audio format in which the resulting stream will be encoded.
* @see OutputFormat
*/
public String getOutputFormat() {
return this.outputFormat;
}
/**
*
* The audio format in which the resulting stream will be encoded.
*
*
* @param outputFormat
* The audio format in which the resulting stream will be encoded.
* @return Returns a reference to this object so that method calls can be chained together.
* @see OutputFormat
*/
public SynthesizeSpeechRequest withOutputFormat(String outputFormat) {
setOutputFormat(outputFormat);
return this;
}
/**
*
* The audio format in which the resulting stream will be encoded.
*
*
* @param outputFormat
* The audio format in which the resulting stream will be encoded.
* @see OutputFormat
*/
public void setOutputFormat(OutputFormat outputFormat) {
this.outputFormat = outputFormat.toString();
}
/**
*
* The audio format in which the resulting stream will be encoded.
*
*
* @param outputFormat
* The audio format in which the resulting stream will be encoded.
* @return Returns a reference to this object so that method calls can be chained together.
* @see OutputFormat
*/
public SynthesizeSpeechRequest withOutputFormat(OutputFormat outputFormat) {
setOutputFormat(outputFormat);
return this;
}
/**
*
* The audio frequency specified in Hz.
*
*
* The valid values for mp3
and ogg_vorbis
are "8000", "16000", and "22050". The default
* value is "22050".
*
*
* Valid values for pcm
are "8000" and "16000" The default value is "16000".
*
*
* @param sampleRate
* The audio frequency specified in Hz.
*
* The valid values for mp3
and ogg_vorbis
are "8000", "16000", and "22050". The
* default value is "22050".
*
*
* Valid values for pcm
are "8000" and "16000" The default value is "16000".
*/
public void setSampleRate(String sampleRate) {
this.sampleRate = sampleRate;
}
/**
*
* The audio frequency specified in Hz.
*
*
* The valid values for mp3
and ogg_vorbis
are "8000", "16000", and "22050". The default
* value is "22050".
*
*
* Valid values for pcm
are "8000" and "16000" The default value is "16000".
*
*
* @return The audio frequency specified in Hz.
*
* The valid values for mp3
and ogg_vorbis
are "8000", "16000", and "22050". The
* default value is "22050".
*
*
* Valid values for pcm
are "8000" and "16000" The default value is "16000".
*/
public String getSampleRate() {
return this.sampleRate;
}
/**
*
* The audio frequency specified in Hz.
*
*
* The valid values for mp3
and ogg_vorbis
are "8000", "16000", and "22050". The default
* value is "22050".
*
*
* Valid values for pcm
are "8000" and "16000" The default value is "16000".
*
*
* @param sampleRate
* The audio frequency specified in Hz.
*
* The valid values for mp3
and ogg_vorbis
are "8000", "16000", and "22050". The
* default value is "22050".
*
*
* Valid values for pcm
are "8000" and "16000" The default value is "16000".
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SynthesizeSpeechRequest withSampleRate(String sampleRate) {
setSampleRate(sampleRate);
return this;
}
/**
*
* Input text to synthesize. If you specify ssml
as the TextType
, follow the SSML format
* for the input text.
*
*
* @param text
* Input text to synthesize. If you specify ssml
as the TextType
, follow the SSML
* format for the input text.
*/
public void setText(String text) {
this.text = text;
}
/**
*
* Input text to synthesize. If you specify ssml
as the TextType
, follow the SSML format
* for the input text.
*
*
* @return Input text to synthesize. If you specify ssml
as the TextType
, follow the SSML
* format for the input text.
*/
public String getText() {
return this.text;
}
/**
*
* Input text to synthesize. If you specify ssml
as the TextType
, follow the SSML format
* for the input text.
*
*
* @param text
* Input text to synthesize. If you specify ssml
as the TextType
, follow the SSML
* format for the input text.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SynthesizeSpeechRequest withText(String text) {
setText(text);
return this;
}
/**
*
* Specifies whether the input text is plain text or SSML. The default value is plain text. For more information,
* see Using SSML.
*
*
* @param textType
* Specifies whether the input text is plain text or SSML. The default value is plain text. For more
* information, see Using SSML.
* @see TextType
*/
public void setTextType(String textType) {
this.textType = textType;
}
/**
*
* Specifies whether the input text is plain text or SSML. The default value is plain text. For more information,
* see Using SSML.
*
*
* @return Specifies whether the input text is plain text or SSML. The default value is plain text. For more
* information, see Using SSML.
* @see TextType
*/
public String getTextType() {
return this.textType;
}
/**
*
* Specifies whether the input text is plain text or SSML. The default value is plain text. For more information,
* see Using SSML.
*
*
* @param textType
* Specifies whether the input text is plain text or SSML. The default value is plain text. For more
* information, see Using SSML.
* @return Returns a reference to this object so that method calls can be chained together.
* @see TextType
*/
public SynthesizeSpeechRequest withTextType(String textType) {
setTextType(textType);
return this;
}
/**
*
* Specifies whether the input text is plain text or SSML. The default value is plain text. For more information,
* see Using SSML.
*
*
* @param textType
* Specifies whether the input text is plain text or SSML. The default value is plain text. For more
* information, see Using SSML.
* @see TextType
*/
public void setTextType(TextType textType) {
this.textType = textType.toString();
}
/**
*
* Specifies whether the input text is plain text or SSML. The default value is plain text. For more information,
* see Using SSML.
*
*
* @param textType
* Specifies whether the input text is plain text or SSML. The default value is plain text. For more
* information, see Using SSML.
* @return Returns a reference to this object so that method calls can be chained together.
* @see TextType
*/
public SynthesizeSpeechRequest withTextType(TextType textType) {
setTextType(textType);
return this;
}
/**
*
* Voice ID to use for the synthesis. You can get a list of available voice IDs by calling the DescribeVoices operation.
*
*
* @param voiceId
* Voice ID to use for the synthesis. You can get a list of available voice IDs by calling the DescribeVoices operation.
* @see VoiceId
*/
public void setVoiceId(String voiceId) {
this.voiceId = voiceId;
}
/**
*
* Voice ID to use for the synthesis. You can get a list of available voice IDs by calling the DescribeVoices operation.
*
*
* @return Voice ID to use for the synthesis. You can get a list of available voice IDs by calling the DescribeVoices operation.
* @see VoiceId
*/
public String getVoiceId() {
return this.voiceId;
}
/**
*
* Voice ID to use for the synthesis. You can get a list of available voice IDs by calling the DescribeVoices operation.
*
*
* @param voiceId
* Voice ID to use for the synthesis. You can get a list of available voice IDs by calling the DescribeVoices operation.
* @return Returns a reference to this object so that method calls can be chained together.
* @see VoiceId
*/
public SynthesizeSpeechRequest withVoiceId(String voiceId) {
setVoiceId(voiceId);
return this;
}
/**
*
* Voice ID to use for the synthesis. You can get a list of available voice IDs by calling the DescribeVoices operation.
*
*
* @param voiceId
* Voice ID to use for the synthesis. You can get a list of available voice IDs by calling the DescribeVoices operation.
* @see VoiceId
*/
public void setVoiceId(VoiceId voiceId) {
this.voiceId = voiceId.toString();
}
/**
*
* Voice ID to use for the synthesis. You can get a list of available voice IDs by calling the DescribeVoices operation.
*
*
* @param voiceId
* Voice ID to use for the synthesis. You can get a list of available voice IDs by calling the DescribeVoices operation.
* @return Returns a reference to this object so that method calls can be chained together.
* @see VoiceId
*/
public SynthesizeSpeechRequest withVoiceId(VoiceId voiceId) {
setVoiceId(voiceId);
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 (getLexiconNames() != null)
sb.append("LexiconNames: " + getLexiconNames() + ",");
if (getOutputFormat() != null)
sb.append("OutputFormat: " + getOutputFormat() + ",");
if (getSampleRate() != null)
sb.append("SampleRate: " + getSampleRate() + ",");
if (getText() != null)
sb.append("Text: " + getText() + ",");
if (getTextType() != null)
sb.append("TextType: " + getTextType() + ",");
if (getVoiceId() != null)
sb.append("VoiceId: " + getVoiceId());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof SynthesizeSpeechRequest == false)
return false;
SynthesizeSpeechRequest other = (SynthesizeSpeechRequest) obj;
if (other.getLexiconNames() == null ^ this.getLexiconNames() == null)
return false;
if (other.getLexiconNames() != null && other.getLexiconNames().equals(this.getLexiconNames()) == false)
return false;
if (other.getOutputFormat() == null ^ this.getOutputFormat() == null)
return false;
if (other.getOutputFormat() != null && other.getOutputFormat().equals(this.getOutputFormat()) == false)
return false;
if (other.getSampleRate() == null ^ this.getSampleRate() == null)
return false;
if (other.getSampleRate() != null && other.getSampleRate().equals(this.getSampleRate()) == false)
return false;
if (other.getText() == null ^ this.getText() == null)
return false;
if (other.getText() != null && other.getText().equals(this.getText()) == false)
return false;
if (other.getTextType() == null ^ this.getTextType() == null)
return false;
if (other.getTextType() != null && other.getTextType().equals(this.getTextType()) == false)
return false;
if (other.getVoiceId() == null ^ this.getVoiceId() == null)
return false;
if (other.getVoiceId() != null && other.getVoiceId().equals(this.getVoiceId()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getLexiconNames() == null) ? 0 : getLexiconNames().hashCode());
hashCode = prime * hashCode + ((getOutputFormat() == null) ? 0 : getOutputFormat().hashCode());
hashCode = prime * hashCode + ((getSampleRate() == null) ? 0 : getSampleRate().hashCode());
hashCode = prime * hashCode + ((getText() == null) ? 0 : getText().hashCode());
hashCode = prime * hashCode + ((getTextType() == null) ? 0 : getTextType().hashCode());
hashCode = prime * hashCode + ((getVoiceId() == null) ? 0 : getVoiceId().hashCode());
return hashCode;
}
@Override
public SynthesizeSpeechRequest clone() {
return (SynthesizeSpeechRequest) super.clone();
}
}