/* * Copyright 2018-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.lexruntimev2.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; import com.amazonaws.auth.SignerTypeAware; /** * * @see AWS * API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class RecognizeUtteranceRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable, SignerTypeAware { /** *
* The identifier of the bot that should receive the request. *
*/ private String botId; /** ** The alias identifier in use for the bot that should receive the request. *
*/ private String botAliasId; /** ** The locale where the session is in use. *
*/ private String localeId; /** ** The identifier of the session in use. *
*/ private String sessionId; /** ** Sets the state of the session with the user. You can use this to set the current intent, attributes, context, and * dialog action. Use the dialog action to determine the next step that Amazon Lex V2 should use in the conversation * with the user. *
*
* The sessionState
field must be compressed using gzip and then base64 encoded before sending to
* Amazon Lex V2.
*
* Request-specific information passed between the client application and Amazon Lex V2 *
*
* The namespace x-amz-lex:
is reserved for special attributes. Don't create any request attributes for
* prefix x-amz-lex:
.
*
* The requestAttributes
field must be compressed using gzip and then base64 encoded before sending to
* Amazon Lex V2.
*
* Indicates the format for audio input or that the content is text. The header must start with one of the following * prefixes: *
** PCM format, audio data must be in little-endian byte order. *
** audio/l16; rate=16000; channels=1 *
** audio/x-l16; sample-rate=16000; channel-count=1 *
** audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; is-big-endian=false *
** Opus format *
** audio/x-cbr-opus-with-preamble;preamble-size=0;bit-rate=256000;frame-size-milliseconds=4 *
** Text format *
** text/plain; charset=utf-8 *
*
* The message that Amazon Lex V2 returns in the response can be either text or speech based on the
* responseContentType
value.
*
* If the value is text/plain;charset=utf-8
, Amazon Lex V2 returns text in the response.
*
* If the value begins with audio/
, Amazon Lex V2 returns speech in the response. Amazon Lex V2 uses
* Amazon Polly to generate the speech using the configuration that you specified in the
* responseContentType
parameter. For example, if you specify audio/mpeg
as the value,
* Amazon Lex V2 returns speech in the MPEG format.
*
* If the value is audio/pcm
, the speech returned is audio/pcm
at 16 KHz in 16-bit,
* little-endian format.
*
* The following are the accepted values: *
** audio/mpeg *
** audio/ogg *
** audio/pcm (16 KHz) *
** audio/* (defaults to mpeg) *
** text/plain; charset=utf-8 *
*
* User input in PCM or Opus audio format or text format as described in the requestContentType
* parameter.
*
* The identifier of the bot that should receive the request. *
* * @param botId * The identifier of the bot that should receive the request. */ public void setBotId(String botId) { this.botId = botId; } /** ** The identifier of the bot that should receive the request. *
* * @return The identifier of the bot that should receive the request. */ public String getBotId() { return this.botId; } /** ** The identifier of the bot that should receive the request. *
* * @param botId * The identifier of the bot that should receive the request. * @return Returns a reference to this object so that method calls can be chained together. */ public RecognizeUtteranceRequest withBotId(String botId) { setBotId(botId); return this; } /** ** The alias identifier in use for the bot that should receive the request. *
* * @param botAliasId * The alias identifier in use for the bot that should receive the request. */ public void setBotAliasId(String botAliasId) { this.botAliasId = botAliasId; } /** ** The alias identifier in use for the bot that should receive the request. *
* * @return The alias identifier in use for the bot that should receive the request. */ public String getBotAliasId() { return this.botAliasId; } /** ** The alias identifier in use for the bot that should receive the request. *
* * @param botAliasId * The alias identifier in use for the bot that should receive the request. * @return Returns a reference to this object so that method calls can be chained together. */ public RecognizeUtteranceRequest withBotAliasId(String botAliasId) { setBotAliasId(botAliasId); return this; } /** ** The locale where the session is in use. *
* * @param localeId * The locale where the session is in use. */ public void setLocaleId(String localeId) { this.localeId = localeId; } /** ** The locale where the session is in use. *
* * @return The locale where the session is in use. */ public String getLocaleId() { return this.localeId; } /** ** The locale where the session is in use. *
* * @param localeId * The locale where the session is in use. * @return Returns a reference to this object so that method calls can be chained together. */ public RecognizeUtteranceRequest withLocaleId(String localeId) { setLocaleId(localeId); return this; } /** ** The identifier of the session in use. *
* * @param sessionId * The identifier of the session in use. */ public void setSessionId(String sessionId) { this.sessionId = sessionId; } /** ** The identifier of the session in use. *
* * @return The identifier of the session in use. */ public String getSessionId() { return this.sessionId; } /** ** The identifier of the session in use. *
* * @param sessionId * The identifier of the session in use. * @return Returns a reference to this object so that method calls can be chained together. */ public RecognizeUtteranceRequest withSessionId(String sessionId) { setSessionId(sessionId); return this; } /** ** Sets the state of the session with the user. You can use this to set the current intent, attributes, context, and * dialog action. Use the dialog action to determine the next step that Amazon Lex V2 should use in the conversation * with the user. *
*
* The sessionState
field must be compressed using gzip and then base64 encoded before sending to
* Amazon Lex V2.
*
* The sessionState
field must be compressed using gzip and then base64 encoded before sending
* to Amazon Lex V2.
*/
public void setSessionState(String sessionState) {
this.sessionState = sessionState;
}
/**
*
* Sets the state of the session with the user. You can use this to set the current intent, attributes, context, and * dialog action. Use the dialog action to determine the next step that Amazon Lex V2 should use in the conversation * with the user. *
*
* The sessionState
field must be compressed using gzip and then base64 encoded before sending to
* Amazon Lex V2.
*
* The sessionState
field must be compressed using gzip and then base64 encoded before sending
* to Amazon Lex V2.
*/
public String getSessionState() {
return this.sessionState;
}
/**
*
* Sets the state of the session with the user. You can use this to set the current intent, attributes, context, and * dialog action. Use the dialog action to determine the next step that Amazon Lex V2 should use in the conversation * with the user. *
*
* The sessionState
field must be compressed using gzip and then base64 encoded before sending to
* Amazon Lex V2.
*
* The sessionState
field must be compressed using gzip and then base64 encoded before sending
* to Amazon Lex V2.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RecognizeUtteranceRequest withSessionState(String sessionState) {
setSessionState(sessionState);
return this;
}
/**
*
* Request-specific information passed between the client application and Amazon Lex V2 *
*
* The namespace x-amz-lex:
is reserved for special attributes. Don't create any request attributes for
* prefix x-amz-lex:
.
*
* The requestAttributes
field must be compressed using gzip and then base64 encoded before sending to
* Amazon Lex V2.
*
* The namespace x-amz-lex:
is reserved for special attributes. Don't create any request
* attributes for prefix x-amz-lex:
.
*
* The requestAttributes
field must be compressed using gzip and then base64 encoded before
* sending to Amazon Lex V2.
*/
public void setRequestAttributes(String requestAttributes) {
this.requestAttributes = requestAttributes;
}
/**
*
* Request-specific information passed between the client application and Amazon Lex V2 *
*
* The namespace x-amz-lex:
is reserved for special attributes. Don't create any request attributes for
* prefix x-amz-lex:
.
*
* The requestAttributes
field must be compressed using gzip and then base64 encoded before sending to
* Amazon Lex V2.
*
* The namespace x-amz-lex:
is reserved for special attributes. Don't create any request
* attributes for prefix x-amz-lex:
.
*
* The requestAttributes
field must be compressed using gzip and then base64 encoded before
* sending to Amazon Lex V2.
*/
public String getRequestAttributes() {
return this.requestAttributes;
}
/**
*
* Request-specific information passed between the client application and Amazon Lex V2 *
*
* The namespace x-amz-lex:
is reserved for special attributes. Don't create any request attributes for
* prefix x-amz-lex:
.
*
* The requestAttributes
field must be compressed using gzip and then base64 encoded before sending to
* Amazon Lex V2.
*
* The namespace x-amz-lex:
is reserved for special attributes. Don't create any request
* attributes for prefix x-amz-lex:
.
*
* The requestAttributes
field must be compressed using gzip and then base64 encoded before
* sending to Amazon Lex V2.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RecognizeUtteranceRequest withRequestAttributes(String requestAttributes) {
setRequestAttributes(requestAttributes);
return this;
}
/**
*
* Indicates the format for audio input or that the content is text. The header must start with one of the following * prefixes: *
** PCM format, audio data must be in little-endian byte order. *
** audio/l16; rate=16000; channels=1 *
** audio/x-l16; sample-rate=16000; channel-count=1 *
** audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; is-big-endian=false *
** Opus format *
** audio/x-cbr-opus-with-preamble;preamble-size=0;bit-rate=256000;frame-size-milliseconds=4 *
** Text format *
** text/plain; charset=utf-8 *
** PCM format, audio data must be in little-endian byte order. *
** audio/l16; rate=16000; channels=1 *
** audio/x-l16; sample-rate=16000; channel-count=1 *
** audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; is-big-endian=false *
** Opus format *
** audio/x-cbr-opus-with-preamble;preamble-size=0;bit-rate=256000;frame-size-milliseconds=4 *
** Text format *
** text/plain; charset=utf-8 *
** Indicates the format for audio input or that the content is text. The header must start with one of the following * prefixes: *
** PCM format, audio data must be in little-endian byte order. *
** audio/l16; rate=16000; channels=1 *
** audio/x-l16; sample-rate=16000; channel-count=1 *
** audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; is-big-endian=false *
** Opus format *
** audio/x-cbr-opus-with-preamble;preamble-size=0;bit-rate=256000;frame-size-milliseconds=4 *
** Text format *
** text/plain; charset=utf-8 *
** PCM format, audio data must be in little-endian byte order. *
** audio/l16; rate=16000; channels=1 *
** audio/x-l16; sample-rate=16000; channel-count=1 *
** audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; is-big-endian=false *
** Opus format *
** audio/x-cbr-opus-with-preamble;preamble-size=0;bit-rate=256000;frame-size-milliseconds=4 *
** Text format *
** text/plain; charset=utf-8 *
** Indicates the format for audio input or that the content is text. The header must start with one of the following * prefixes: *
** PCM format, audio data must be in little-endian byte order. *
** audio/l16; rate=16000; channels=1 *
** audio/x-l16; sample-rate=16000; channel-count=1 *
** audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; is-big-endian=false *
** Opus format *
** audio/x-cbr-opus-with-preamble;preamble-size=0;bit-rate=256000;frame-size-milliseconds=4 *
** Text format *
** text/plain; charset=utf-8 *
** PCM format, audio data must be in little-endian byte order. *
** audio/l16; rate=16000; channels=1 *
** audio/x-l16; sample-rate=16000; channel-count=1 *
** audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; is-big-endian=false *
** Opus format *
** audio/x-cbr-opus-with-preamble;preamble-size=0;bit-rate=256000;frame-size-milliseconds=4 *
** Text format *
** text/plain; charset=utf-8 *
*
* The message that Amazon Lex V2 returns in the response can be either text or speech based on the
* responseContentType
value.
*
* If the value is text/plain;charset=utf-8
, Amazon Lex V2 returns text in the response.
*
* If the value begins with audio/
, Amazon Lex V2 returns speech in the response. Amazon Lex V2 uses
* Amazon Polly to generate the speech using the configuration that you specified in the
* responseContentType
parameter. For example, if you specify audio/mpeg
as the value,
* Amazon Lex V2 returns speech in the MPEG format.
*
* If the value is audio/pcm
, the speech returned is audio/pcm
at 16 KHz in 16-bit,
* little-endian format.
*
* The following are the accepted values: *
** audio/mpeg *
** audio/ogg *
** audio/pcm (16 KHz) *
** audio/* (defaults to mpeg) *
** text/plain; charset=utf-8 *
*responseContentType
value.
*
* If the value is text/plain;charset=utf-8
, Amazon Lex V2 returns text in the response.
*
* If the value begins with audio/
, Amazon Lex V2 returns speech in the response. Amazon Lex V2
* uses Amazon Polly to generate the speech using the configuration that you specified in the
* responseContentType
parameter. For example, if you specify audio/mpeg
as the
* value, Amazon Lex V2 returns speech in the MPEG format.
*
* If the value is audio/pcm
, the speech returned is audio/pcm
at 16 KHz in 16-bit,
* little-endian format.
*
* The following are the accepted values: *
** audio/mpeg *
** audio/ogg *
** audio/pcm (16 KHz) *
** audio/* (defaults to mpeg) *
** text/plain; charset=utf-8 *
*
* The message that Amazon Lex V2 returns in the response can be either text or speech based on the
* responseContentType
value.
*
* If the value is text/plain;charset=utf-8
, Amazon Lex V2 returns text in the response.
*
* If the value begins with audio/
, Amazon Lex V2 returns speech in the response. Amazon Lex V2 uses
* Amazon Polly to generate the speech using the configuration that you specified in the
* responseContentType
parameter. For example, if you specify audio/mpeg
as the value,
* Amazon Lex V2 returns speech in the MPEG format.
*
* If the value is audio/pcm
, the speech returned is audio/pcm
at 16 KHz in 16-bit,
* little-endian format.
*
* The following are the accepted values: *
** audio/mpeg *
** audio/ogg *
** audio/pcm (16 KHz) *
** audio/* (defaults to mpeg) *
** text/plain; charset=utf-8 *
*responseContentType
value.
*
* If the value is text/plain;charset=utf-8
, Amazon Lex V2 returns text in the response.
*
* If the value begins with audio/
, Amazon Lex V2 returns speech in the response. Amazon Lex V2
* uses Amazon Polly to generate the speech using the configuration that you specified in the
* responseContentType
parameter. For example, if you specify audio/mpeg
as the
* value, Amazon Lex V2 returns speech in the MPEG format.
*
* If the value is audio/pcm
, the speech returned is audio/pcm
at 16 KHz in
* 16-bit, little-endian format.
*
* The following are the accepted values: *
** audio/mpeg *
** audio/ogg *
** audio/pcm (16 KHz) *
** audio/* (defaults to mpeg) *
** text/plain; charset=utf-8 *
*
* The message that Amazon Lex V2 returns in the response can be either text or speech based on the
* responseContentType
value.
*
* If the value is text/plain;charset=utf-8
, Amazon Lex V2 returns text in the response.
*
* If the value begins with audio/
, Amazon Lex V2 returns speech in the response. Amazon Lex V2 uses
* Amazon Polly to generate the speech using the configuration that you specified in the
* responseContentType
parameter. For example, if you specify audio/mpeg
as the value,
* Amazon Lex V2 returns speech in the MPEG format.
*
* If the value is audio/pcm
, the speech returned is audio/pcm
at 16 KHz in 16-bit,
* little-endian format.
*
* The following are the accepted values: *
** audio/mpeg *
** audio/ogg *
** audio/pcm (16 KHz) *
** audio/* (defaults to mpeg) *
** text/plain; charset=utf-8 *
*responseContentType
value.
*
* If the value is text/plain;charset=utf-8
, Amazon Lex V2 returns text in the response.
*
* If the value begins with audio/
, Amazon Lex V2 returns speech in the response. Amazon Lex V2
* uses Amazon Polly to generate the speech using the configuration that you specified in the
* responseContentType
parameter. For example, if you specify audio/mpeg
as the
* value, Amazon Lex V2 returns speech in the MPEG format.
*
* If the value is audio/pcm
, the speech returned is audio/pcm
at 16 KHz in 16-bit,
* little-endian format.
*
* The following are the accepted values: *
** audio/mpeg *
** audio/ogg *
** audio/pcm (16 KHz) *
** audio/* (defaults to mpeg) *
** text/plain; charset=utf-8 *
*
* User input in PCM or Opus audio format or text format as described in the requestContentType
* parameter.
*
requestContentType
* parameter.
*/
public void setInputStream(java.io.InputStream inputStream) {
this.inputStream = inputStream;
}
/**
*
* User input in PCM or Opus audio format or text format as described in the requestContentType
* parameter.
*
requestContentType
* parameter.
*/
public java.io.InputStream getInputStream() {
return this.inputStream;
}
/**
*
* User input in PCM or Opus audio format or text format as described in the requestContentType
* parameter.
*
requestContentType
* parameter.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RecognizeUtteranceRequest withInputStream(java.io.InputStream inputStream) {
setInputStream(inputStream);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getBotId() != null)
sb.append("BotId: ").append(getBotId()).append(",");
if (getBotAliasId() != null)
sb.append("BotAliasId: ").append(getBotAliasId()).append(",");
if (getLocaleId() != null)
sb.append("LocaleId: ").append(getLocaleId()).append(",");
if (getSessionId() != null)
sb.append("SessionId: ").append(getSessionId()).append(",");
if (getSessionState() != null)
sb.append("SessionState: ").append("***Sensitive Data Redacted***").append(",");
if (getRequestAttributes() != null)
sb.append("RequestAttributes: ").append("***Sensitive Data Redacted***").append(",");
if (getRequestContentType() != null)
sb.append("RequestContentType: ").append(getRequestContentType()).append(",");
if (getResponseContentType() != null)
sb.append("ResponseContentType: ").append(getResponseContentType()).append(",");
if (getInputStream() != null)
sb.append("InputStream: ").append(getInputStream());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof RecognizeUtteranceRequest == false)
return false;
RecognizeUtteranceRequest other = (RecognizeUtteranceRequest) obj;
if (other.getBotId() == null ^ this.getBotId() == null)
return false;
if (other.getBotId() != null && other.getBotId().equals(this.getBotId()) == false)
return false;
if (other.getBotAliasId() == null ^ this.getBotAliasId() == null)
return false;
if (other.getBotAliasId() != null && other.getBotAliasId().equals(this.getBotAliasId()) == false)
return false;
if (other.getLocaleId() == null ^ this.getLocaleId() == null)
return false;
if (other.getLocaleId() != null && other.getLocaleId().equals(this.getLocaleId()) == false)
return false;
if (other.getSessionId() == null ^ this.getSessionId() == null)
return false;
if (other.getSessionId() != null && other.getSessionId().equals(this.getSessionId()) == false)
return false;
if (other.getSessionState() == null ^ this.getSessionState() == null)
return false;
if (other.getSessionState() != null && other.getSessionState().equals(this.getSessionState()) == false)
return false;
if (other.getRequestAttributes() == null ^ this.getRequestAttributes() == null)
return false;
if (other.getRequestAttributes() != null && other.getRequestAttributes().equals(this.getRequestAttributes()) == false)
return false;
if (other.getRequestContentType() == null ^ this.getRequestContentType() == null)
return false;
if (other.getRequestContentType() != null && other.getRequestContentType().equals(this.getRequestContentType()) == false)
return false;
if (other.getResponseContentType() == null ^ this.getResponseContentType() == null)
return false;
if (other.getResponseContentType() != null && other.getResponseContentType().equals(this.getResponseContentType()) == false)
return false;
if (other.getInputStream() == null ^ this.getInputStream() == null)
return false;
if (other.getInputStream() != null && other.getInputStream().equals(this.getInputStream()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getBotId() == null) ? 0 : getBotId().hashCode());
hashCode = prime * hashCode + ((getBotAliasId() == null) ? 0 : getBotAliasId().hashCode());
hashCode = prime * hashCode + ((getLocaleId() == null) ? 0 : getLocaleId().hashCode());
hashCode = prime * hashCode + ((getSessionId() == null) ? 0 : getSessionId().hashCode());
hashCode = prime * hashCode + ((getSessionState() == null) ? 0 : getSessionState().hashCode());
hashCode = prime * hashCode + ((getRequestAttributes() == null) ? 0 : getRequestAttributes().hashCode());
hashCode = prime * hashCode + ((getRequestContentType() == null) ? 0 : getRequestContentType().hashCode());
hashCode = prime * hashCode + ((getResponseContentType() == null) ? 0 : getResponseContentType().hashCode());
hashCode = prime * hashCode + ((getInputStream() == null) ? 0 : getInputStream().hashCode());
return hashCode;
}
@Override
public RecognizeUtteranceRequest clone() {
return (RecognizeUtteranceRequest) super.clone();
}
@Override
public String getSignerType() {
return "AWS4UnsignedPayloadSignerType";
}
}