public class ResponseBuilder extends Object
| Constructor and Description |
|---|
ResponseBuilder() |
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 withCard(com.amazon.ask.model.ui.Card card)
Card object on the response.card - card objectpublic 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 devicepublic ResponseBuilder withCanFulfillIntent(com.amazon.ask.model.canfulfill.CanFulfillIntent canFulfillIntent)
canFulfillIntent - Copyright © Amazon.com, Inc. or its affiliates. All Rights Reserved.