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 ClearQueue directive - clear the queue without stopping the currently playing stream,
or clear the queue and stop any currently playing stream.
|
ResponseBuilder |
addAudioPlayerPlayDirective(com.amazon.ask.model.interfaces.audioplayer.PlayBehavior playBehavior,
Long offsetInMilliseconds,
String expectedPreviousToken,
String token,
String url)
Adds an AudioPlayer play directive
|
ResponseBuilder |
addAudioPlayerStopDirective()
Adds an AudioPlayer Stop directive - Stops the current audio Playback
|
ResponseBuilder |
addConfirmIntentDirective(com.amazon.ask.model.Intent updatedIntent)
Adds a Dialog confirmIntent directive to response
|
ResponseBuilder |
addConfirmSlotDirective(String slotName,
com.amazon.ask.model.Intent updatedIntent)
Adds a Dialog confirmSlot directive to response
|
ResponseBuilder |
addDelegateDirective(com.amazon.ask.model.Intent updatedIntent)
Adds a Dialog delegate directive to response
|
ResponseBuilder |
addDirective(com.amazon.ask.model.Directive directive)
Helper method for adding directives to responses
|
ResponseBuilder |
addElicitSlotDirective(String slotName,
com.amazon.ask.model.Intent updatedIntent)
Adds a Dialog elicitSlot directive to response
|
ResponseBuilder |
addHintDirective(String hintText)
Adds a hint directive - show a hint on the screen of the echo show
|
ResponseBuilder |
addRenderTemplateDirective(com.amazon.ask.model.interfaces.display.Template template)
Adds a Display RenderTemplate Directive
|
ResponseBuilder |
addVideoAppLaunchDirective(String source,
String title,
String subtitle)
Adds a VideoApp play directive to play a video
|
Optional<com.amazon.ask.model.Response> |
build() |
ResponseBuilder |
withAskForPermissionsConsentCard(List<String> permissions)
Renders an AskForPermissionsConsent card
|
ResponseBuilder |
withLinkAccountCard()
Renders a link account card
|
ResponseBuilder |
withReprompt(String text)
Has alexa listen for speech from the user.
|
ResponseBuilder |
withShouldEndSession(Boolean shouldEndSession)
Sets shouldEndSession value to null/false/true
|
ResponseBuilder |
withSimpleCard(String cardTitle,
String cardText)
Renders a simple card with the specified title and content
|
ResponseBuilder |
withSpeech(String speechText)
Has Alexa say the provided speech to the user
|
ResponseBuilder |
withStandardCard(String cardTitle,
String cardText,
com.amazon.ask.model.ui.Image image)
Renders a standard card with the specified title, content and image
|
public Optional<com.amazon.ask.model.Response> build()
public ResponseBuilder withSpeech(String speechText)
speechText - speech textpublic ResponseBuilder withSimpleCard(String cardTitle, String cardText)
cardTitle - title for cardcardText - text in the cardpublic ResponseBuilder withStandardCard(String cardTitle, String cardText, com.amazon.ask.model.ui.Image image)
cardTitle - title for cardcardText - text in the cardimage - imagepublic ResponseBuilder withLinkAccountCard()
public ResponseBuilder withAskForPermissionsConsentCard(List<String> permissions)
permissions - permission arraypublic ResponseBuilder withReprompt(String text)
text - reprompt textpublic ResponseBuilder withShouldEndSession(Boolean shouldEndSession)
shouldEndSession - whether session should end or notpublic ResponseBuilder addHintDirective(String hintText)
hintText - hint textpublic ResponseBuilder addVideoAppLaunchDirective(String source, String title, String subtitle)
source - Identifies the location of video content at a remote HTTPS location and video file must be hosted at an Internet-accessible HTTPS endpointtitle - title that can be displayed on VideoAppsubtitle - subtitle that can be displayed on videoApppublic ResponseBuilder addRenderTemplateDirective(com.amazon.ask.model.interfaces.display.Template template)
template - display templatepublic ResponseBuilder addDelegateDirective(com.amazon.ask.model.Intent updatedIntent)
updatedIntent - updated intentpublic ResponseBuilder addElicitSlotDirective(String slotName, com.amazon.ask.model.Intent updatedIntent)
slotName - name of slotupdatedIntent - updated intentpublic ResponseBuilder addConfirmSlotDirective(String slotName, com.amazon.ask.model.Intent updatedIntent)
slotName - name of slotupdatedIntent - updated intentpublic ResponseBuilder addConfirmIntentDirective(com.amazon.ask.model.Intent updatedIntent)
updatedIntent - updated intentpublic ResponseBuilder addAudioPlayerPlayDirective(com.amazon.ask.model.interfaces.audioplayer.PlayBehavior playBehavior, Long offsetInMilliseconds, String expectedPreviousToken, String token, String url)
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()
public ResponseBuilder addAudioPlayerClearQueueDirective(com.amazon.ask.model.interfaces.audioplayer.ClearBehavior clearBehavior)
clearBehavior - Describes the clear queue behaviorpublic ResponseBuilder addDirective(com.amazon.ask.model.Directive directive)
directive - directive the directive send back to Alexa deviceCopyright © Amazon.com, Inc. or its affiliates. All Rights Reserved.