public final class LexServiceContinuation
extends java.lang.Object
"Continuation"s provide a simple technique to continue with a transaction after a user responds to a prompt from the Amazon Lex service. This encapsulates and provides access to responses from the Amazon Lex service.
| Constructor and Description |
|---|
LexServiceContinuation(InteractionClient interactionClient,
ResponseType responseMode,
ResponseType requestMode)
Constructs a continuation for speech request.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Use this method to cancel the current transaction.
|
void |
continueWithAudioInForAudioOut()
Use this method if the users response is speech.
|
void |
continueWithAudioInForAudioOut(java.util.Map<java.lang.String,java.lang.String> requestAttributes)
Use this method if the users response is speech.
|
void |
continueWithAudioInForTextOut()
Use this method if the users response is speech.
|
void |
continueWithAudioInForTextOut(java.util.Map<java.lang.String,java.lang.String> requestAttributes)
Use this method if the users response is speech.
|
void |
continueWithCurrentMode()
Use this method to continue with the current audio input and output mode, and current session attributes.
|
void |
continueWithTextInForAudioOut(java.lang.String text)
Use this method to respond with text and expect service response with audio.
|
void |
continueWithTextInForAudioOut(java.lang.String text,
java.util.Map<java.lang.String,java.lang.String> requestAttributes)
Use this method to respond with text and expect service response with audio.
|
void |
continueWithTextInForTextOut(java.lang.String text)
Use this method to respond with text and expect service response with text.
|
void |
continueWithTextInForTextOut(java.lang.String text,
java.util.Map<java.lang.String,java.lang.String> requestAttributes)
Use this method to respond with text and expect service response with text.
|
java.lang.String |
getSessionAttribute(java.lang.String attribute)
Returns a specific session attribute.
|
java.util.Map<java.lang.String,java.lang.String> |
getSessionAttributes()
Returns all session attributes.
|
void |
setSessionAttribute(java.lang.String attribute,
java.lang.String value)
Set value for a specific session attribute, will over-write current value.
|
void |
setSessionAttributes(java.util.Map<java.lang.String,java.lang.String> sessionAttributes)
Replace all session attributes with a new set.
|
public LexServiceContinuation(InteractionClient interactionClient, ResponseType responseMode, ResponseType requestMode)
interactionClient - InteractionClient.public java.lang.String getSessionAttribute(java.lang.String attribute)
attribute - the request attribute as a String.public java.util.Map<java.lang.String,java.lang.String> getSessionAttributes()
Map.public void setSessionAttributes(java.util.Map<java.lang.String,java.lang.String> sessionAttributes)
sessionAttributes - Map.public void setSessionAttribute(java.lang.String attribute,
java.lang.String value)
attribute - name of the attribute as String.value - value of the attribute as String.public void continueWithAudioInForTextOut()
public void continueWithAudioInForTextOut(java.util.Map<java.lang.String,java.lang.String> requestAttributes)
requestAttributes - attributes to add to this requestpublic void continueWithAudioInForAudioOut()
public void continueWithAudioInForAudioOut(java.util.Map<java.lang.String,java.lang.String> requestAttributes)
requestAttributes - attributes to add to this requestpublic void continueWithTextInForAudioOut(java.lang.String text)
text - the response to the prompt as a String.public void continueWithTextInForAudioOut(java.lang.String text,
java.util.Map<java.lang.String,java.lang.String> requestAttributes)
text - the response to the prompt as a String.requestAttributes - attributes to add to this requestpublic void continueWithTextInForTextOut(java.lang.String text)
text - the response to the prompt as a String.public void continueWithTextInForTextOut(java.lang.String text,
java.util.Map<java.lang.String,java.lang.String> requestAttributes)
text - the response to the prompt as a String.requestAttributes - attributes to add to this requestpublic void continueWithCurrentMode()
public void cancel()
Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.