public class ResponseBuilder extends Object
| Constructor and Description |
|---|
ResponseBuilder() |
| Modifier and Type | Method and Description |
|---|---|
ResponseBuilder |
addAudioPlayerClearQueueDirective(com.amazon.ask.model.interfaces.audioplayer.ClearBehavior clearBehavior)
Adds an AudioPlayer
ClearQueueDirective to the response. |
ResponseBuilder |
addAudioPlayerPlayDirective(com.amazon.ask.model.interfaces.audioplayer.PlayBehavior playBehavior,
Long offsetInMilliseconds,
String expectedPreviousToken,
String token,
String url)
Adds an AudioPlayer
PlayDirective to the response. |
ResponseBuilder |
addAudioPlayerStopDirective()
Adds an AudioPlayer
StopDirective to the response. |
ResponseBuilder |
addConfirmIntentDirective(com.amazon.ask.model.Intent updatedIntent)
Adds a Dialog
ConfirmIntentDirective to the response. |
ResponseBuilder |
addConfirmSlotDirective(String slotName,
com.amazon.ask.model.Intent updatedIntent)
Adds a Dialog
ConfirmSlotDirective to the response. |
ResponseBuilder |
addDelegateDirective(com.amazon.ask.model.Intent updatedIntent)
Adds a Dialog
DelegateDirective to the response. |
ResponseBuilder |
addDirective(com.amazon.ask.model.Directive directive)
Adds a given
Directive to the response. |
ResponseBuilder |
addElicitSlotDirective(String slotName,
com.amazon.ask.model.Intent updatedIntent)
Adds a Dialog
ElicitSlotDirective to the response. |
ResponseBuilder |
addHintDirective(String hintText)
Adds a
HintDirective to the response. |
ResponseBuilder |
addRenderTemplateDirective(com.amazon.ask.model.interfaces.display.Template template)
Adds a Display
RenderTemplateDirective to the response. |
ResponseBuilder |
addVideoAppLaunchDirective(String source,
String title,
String subtitle)
Adds a VideoApp
LaunchDirective to the response to play a video. |
Optional<com.amazon.ask.model.Response> |
build() |
ResponseBuilder |
withAskForPermissionsConsentCard(List<String> permissions)
Sets a
AskForPermissionsConsentCard card on the response. |
ResponseBuilder |
withLinkAccountCard()
Sets a
LinkAccountCard on the response. |
ResponseBuilder |
withReprompt(String text)
Sets
Reprompt speech on the response. |
ResponseBuilder |
withShouldEndSession(Boolean shouldEndSession)
Sets whether the session should end after this response.
|
ResponseBuilder |
withSimpleCard(String cardTitle,
String cardText)
Sets a simple
Card on the response with the specified title and content. |
ResponseBuilder |
withSpeech(String speechText)
Sets
OutputSpeech on the response. |
ResponseBuilder |
withStandardCard(String cardTitle,
String cardText,
com.amazon.ask.model.ui.Image image)
Sets a standard
Card on the response with the specified title, content and image |
public Optional<com.amazon.ask.model.Response> build()
public ResponseBuilder withSpeech(String speechText)
OutputSpeech on the response. Speech is always wrapped in SSML tags.speechText - speech textpublic ResponseBuilder withSimpleCard(String cardTitle, String cardText)
Card on the response with the specified title and content.cardTitle - title for cardcardText - text in the cardpublic ResponseBuilder withStandardCard(String cardTitle, String cardText, com.amazon.ask.model.ui.Image image)
Card on the response with the specified title, content and imagecardTitle - title for cardcardText - text in the cardimage - imagepublic ResponseBuilder withLinkAccountCard()
LinkAccountCard on the response.public ResponseBuilder withAskForPermissionsConsentCard(List<String> permissions)
AskForPermissionsConsentCard card on the response.permissions - permission arraypublic ResponseBuilder withReprompt(String text)
Reprompt speech on the response. Speech is always wrapped in SSML tags.text - reprompt textpublic ResponseBuilder withShouldEndSession(Boolean shouldEndSession)
shouldEndSession - whether session should end or not, or nullpublic ResponseBuilder addHintDirective(String hintText)
HintDirective to the response.hintText - hint textpublic ResponseBuilder addVideoAppLaunchDirective(String source, String title, String subtitle)
LaunchDirective to the response to play a video.source - location of video content at a remote HTTPS locationtitle - title that can be displayed on VideoAppsubtitle - subtitle that can be displayed on VideoApppublic ResponseBuilder addRenderTemplateDirective(com.amazon.ask.model.interfaces.display.Template template)
RenderTemplateDirective to the response.template - display templatepublic ResponseBuilder addDelegateDirective(com.amazon.ask.model.Intent updatedIntent)
DelegateDirective to the response.updatedIntent - updated intentpublic ResponseBuilder addElicitSlotDirective(String slotName, com.amazon.ask.model.Intent updatedIntent)
ElicitSlotDirective to the response.slotName - name of slot to elicitupdatedIntent - updated intentpublic ResponseBuilder addConfirmSlotDirective(String slotName, com.amazon.ask.model.Intent updatedIntent)
ConfirmSlotDirective to the response.slotName - name of slot to elicitupdatedIntent - updated intentpublic ResponseBuilder addConfirmIntentDirective(com.amazon.ask.model.Intent updatedIntent)
ConfirmIntentDirective to the response.updatedIntent - updated intentpublic ResponseBuilder addAudioPlayerPlayDirective(com.amazon.ask.model.interfaces.audioplayer.PlayBehavior playBehavior, Long offsetInMilliseconds, String expectedPreviousToken, String token, String url)
PlayDirective to the response.playBehavior - Describes playback behavioroffsetInMilliseconds - The timestamp in the stream from which Alexa should begin playbackexpectedPreviousToken - A token that represents the expected previous streamtoken - A token that represents the audio stream. This token cannot exceed 1024 charactersurl - Identifies the location of audio content at a remote HTTPS locationpublic ResponseBuilder addAudioPlayerStopDirective()
StopDirective to the response.public ResponseBuilder addAudioPlayerClearQueueDirective(com.amazon.ask.model.interfaces.audioplayer.ClearBehavior clearBehavior)
ClearQueueDirective to the response.clearBehavior - Describes the clear queue behaviorpublic ResponseBuilder addDirective(com.amazon.ask.model.Directive directive)
Directive to the response.directive - directive to send with the response back to the Alexa deviceCopyright © Amazon.com, Inc. or its affiliates. All Rights Reserved.