Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Latest commit

 

History

History
35 lines (29 loc) · 11.9 KB

File metadata and controls

35 lines (29 loc) · 11.9 KB

core / org.rewedigital.dialog.handler / DialogflowResponseBuilder

DialogflowResponseBuilder

class DialogflowResponseBuilder

Constructors

Name Summary
<init> DialogflowResponseBuilder(dialogflowHandler: DialogflowHandler)

Functions

Name Summary
askGoogleForCoarseLocation fun askGoogleForCoarseLocation(reason: String): DialogflowResponseBuilder
Helper function to ask the user for Permissions.DEVICE_COARSE_LOCATION permission. DialogflowHandler.permissionGranted will return true if the permission was granted.
askGoogleForLocation fun askGoogleForLocation(reason: String): DialogflowResponseBuilder
Helper function to ask the user for Permissions.DEVICE_COARSE_LOCATION and Permissions.DEVICE_PRECISE_LOCATION permission. DialogflowHandler.permissionGranted will return true if the permission was granted.
askGoogleForPreciseLocation fun askGoogleForPreciseLocation(reason: String): DialogflowResponseBuilder
Helper function to ask the user for Permissions.DEVICE_PRECISE_LOCATION permission. DialogflowHandler.permissionGranted will return true if the permission was granted.
askGoogleForSignIn fun askGoogleForSignIn(): DialogflowResponseBuilder
Helper function to ask the user to start the sign-in process. DialogflowHandler.signInStatus will return the result of the sign-in process.
build fun build(): WebhookResponse
Returns the WebhookResponse and WebhookResponse.validate the result.
expectUserResponse fun expectUserResponse(expectResponse: Boolean): DialogflowResponseBuilder
Set this true if the agent awaits a response from the user or false if the agent should close the session.
withCard fun withCard(card: Card, platform: Platform? = null): DialogflowResponseBuilder
Adds a Card for the given Platform.
withGoogleBasicCard fun withGoogleBasicCard(basicCard: GoogleBasicCard): DialogflowResponseBuilder
fun withGoogleBasicCard(title: String, subtitle: String? = null, formattedText: String? = null, image: GoogleImage? = null, buttons: MutableList<GoogleButton> = mutableListOf(), imageDisplayOptions: ImageDisplayOptions? = ImageDisplayOptions.CROPPED): DialogflowResponseBuilder
Adds a GoogleBasicCard. RichResponse must start with a GoogleSimpleResponse. Only one GoogleBasicCard per RichResponse is allowed.
withGoogleCarouselSelect fun withGoogleCarouselSelect(vararg carouselItems: GoogleCarouselItem): DialogflowResponseBuilder
Adds a GoogleCarouselSelect with the given GoogleCarouselItem. In addition there must be at least one RichResponse item.
withGoogleLinkOutSuggestion fun withGoogleLinkOutSuggestion(linkOutSuggestion: LinkOutSuggestion): DialogflowResponseBuilder
Adds LinkOutSuggestion.
withGoogleListSelect fun withGoogleListSelect(listSelect: ListSelect): DialogflowResponseBuilder
Adds a ListSelect for the Platform.ACTIONS_ON_GOOGLE.
withGoogleReprompts fun withGoogleReprompts(vararg repropmpts: String): DialogflowResponseBuilder
Adds a list of repromts.fun withGoogleReprompts(vararg repropmpts: GoogleSimpleResponse): DialogflowResponseBuilder
Adds a list of GoogleSimpleResponse as repromts.
withGoogleSimpleResponse fun withGoogleSimpleResponse(simpleResponse: GoogleSimpleResponse): DialogflowResponseBuilder
Adds a GoogleSimpleResponse. RichResponse must start with a GoogleSimpleResponse. A maximum of two GoogleSimpleResponse per RichResponse are allowed.fun withGoogleSimpleResponse(simpleResponse: String): DialogflowResponseBuilder
Adds a GoogleSimpleResponse with the given string. RichResponse must start with a GoogleSimpleResponse. A maximum of two GoogleSimpleResponse per RichResponse are allowed.
withGoogleSimpleResponses fun withGoogleSimpleResponses(simpleResponses: GoogleSimpleResponses): DialogflowResponseBuilder
Adds GoogleSimpleResponses. RichResponse must start with a GoogleSimpleResponse. A maximum of two GoogleSimpleResponse per RichResponse are allowed.
withGoogleSuggestions fun withGoogleSuggestions(suggestions: Suggestions): DialogflowResponseBuilder
Adds Suggestions.fun withGoogleSuggestions(vararg suggestions: String): DialogflowResponseBuilder
Adds Suggestions with the given strings.
withImage fun withImage(image: Image, platform: Platform? = null): DialogflowResponseBuilder
Adds an Image for the given Platform.
withQuickReplies fun withQuickReplies(quickReplies: QuickReplies, platform: Platform? = null): DialogflowResponseBuilder
Adds QuickReplies for the given Platform.
withText fun withText(text: String): DialogflowResponseBuilder
Set the FulfillmentText for Dialogflow.
withTextMessage fun withTextMessage(text: TextMessage, platform: Platform? = null): DialogflowResponseBuilder
Adds a TextMessage with the given Platform.fun withTextMessage(vararg text: String, platform: Platform? = null): DialogflowResponseBuilder
Adds a TextMessage with a list of a given string and Platform.