tock / ai.tock.bot.connector.web

Package ai.tock.bot.connector.web

Web Connector implementation

Types

OldWebMessage

data class OldWebMessage : WebConnectorMessage

WebButton

data class WebButton

WebConnector

class WebConnector : ConnectorBase, OrchestrationConnector

WebConnectorMessage

interface WebConnectorMessage : SerializableConnectorMessage

WebConnectorRequest

data class WebConnectorRequest

WebMessage

data class WebMessage : WebConnectorMessage

WebRequestInfos

data class WebRequestInfos

WebRequestInfosByEvent

object WebRequestInfosByEvent

Annotations

WebHandler

To specify ConnectorStoryHandler for Web connector. KClass passed as value of this annotation must have a primary constructor with a single not optional StoryHandlerDefinitionBase argument.

annotation class WebHandler

Extensions for External Classes

ai.tock.bot.connector.web.send.Button

ai.tock.bot.connector.web.send.WebCard

ai.tock.bot.connector.web.send.WebCarousel

ai.tock.bot.connector.web.send.WebWidget

Properties

webConnectorType

The web (REST) connector type.

val webConnectorType: ConnectorType

Functions

toGenericMessage

fun <ERROR CLASS>.toGenericMessage(): GenericMessage

toMediaFile

fun <ERROR CLASS>.toMediaFile(): MediaFile

toWebMediaFile

fun MediaFile.toWebMediaFile(): <ERROR CLASS>

webButton

Creates a button.

fun <T : Bus<T>> T.webButton(title: CharSequence, targetIntent: IntentAware? = null, imageUrl: String? = null, step: StoryStep<out StoryHandlerDefinition>? = null, parameters: Parameters = Parameters()): WebButton

webCard

Creates a WebMessage from a WebCard.

fun <T : Bus<T>> T.webCard(card: WebCard): WebMessagefun <T : Bus<T>> T.webCard(title: CharSequence?, subTitle: CharSequence?, buttons: List<Button> = emptyList()): WebCard

Creates a OldWebMessage from a MediaCard.

fun <T : Bus<T>> T.webCard(card: MediaCard): OldWebMessage

webCardWithAttachment

fun <T : Bus<T>> T.webCardWithAttachment(title: CharSequence?, subTitle: CharSequence?, attachmentUrl: CharSequence, buttons: List<Button>, type: AttachmentType = AttachmentType.file, attachementName: String = ""): WebCard

webCarousel

Creates a WebMessage from a WebCarousel.

fun <T : Bus<T>> T.webCarousel(vararg cards: WebCard, buttons: List<Button> = emptyList()): WebMessagefun <T : Bus<T>> T.webCarousel(cards: List<WebCard>, buttons: List<Button> = emptyList()): WebMessage

Creates a OldWebMessage from a MediaCarousel.

fun <T : Bus<T>> T.webCarousel(carousel: MediaCarousel): OldWebMessage

webDeepLink

fun <T : Bus<T>> T.webDeepLink(ref: String): WebMessage

webImage

Creates a WebMessage from a WebImage.

fun <T : Bus<T>> T.webImage(imageUrl: String, title: CharSequence): WebMessage

webIntentQuickReply

Creates a quickreply button with target intent

fun <T : Bus<T>> T.webIntentQuickReply(title: CharSequence, targetIntent: IntentAware, step: StoryStep<out StoryHandlerDefinition>? = null, parameters: Parameters = Parameters(), imageUrl: String? = null, style: <ERROR CLASS>): Button
fun <T : Bus<T>> T.webIntentQuickReply(title: CharSequence, targetIntent: IntentAware, step: StoryStep<out StoryHandlerDefinition>? = null, parameters: Parameters = Parameters(), imageUrl: String? = null, style: String? = ButtonStyle.primary.name): Button

WebMediaFile

fun WebMediaFile(url: String, name: String, type: AttachmentType = attachmentType(url)): <ERROR CLASS>

webMessage

Creates a text with buttons.

fun I18nTranslator.webMessage(title: CharSequence, vararg buttons: WebButton): OldWebMessage
fun I18nTranslator.webMessage(title: CharSequence, buttons: List<WebButton>): OldWebMessage
fun I18nTranslator.webMessage(title: CharSequence, vararg buttons: Button): WebMessage

Creates a text with a list of buttons.

fun I18nTranslator.webMessage(title: CharSequence, buttons: List<Button> = emptyList()): WebMessage

webNlpQuickReply

Creates a quickreply button with target intent

fun <T : Bus<T>> T.webNlpQuickReply(title: CharSequence, nlpText: String? = null, imageUrl: String? = null, style: <ERROR CLASS>): Button
fun <T : Bus<T>> T.webNlpQuickReply(title: CharSequence, nlpText: String? = null, imageUrl: String? = null, style: String? = ButtonStyle.primary.name): Button

webPostbackButton

Creates a postback button

fun <T : Bus<T>> T.webPostbackButton(title: CharSequence, targetIntent: IntentAware, step: StoryStep<out StoryHandlerDefinition>? = null, parameters: Parameters = Parameters(), imageUrl: String? = null, style: <ERROR CLASS>): Button
fun <T : Bus<T>> T.webPostbackButton(title: CharSequence, targetIntent: IntentAware, step: StoryStep<out StoryHandlerDefinition>? = null, parameters: Parameters = Parameters(), imageUrl: String? = null, style: String? = ButtonStyle.primary.name): Button

webQuickReply

Creates a quickreply button

fun <T : Bus<T>> T.webQuickReply(title: CharSequence, targetIntent: IntentAware? = null, step: StoryStep<out StoryHandlerDefinition>? = null, parameters: Parameters = Parameters(), imageUrl: String? = null): Button

webTextButton

Creates a button from a text.

fun <T : Bus<T>> T.webTextButton(text: CharSequence): WebButton

webUrlButton

Creates a url button

fun <T : Bus<T>> T.webUrlButton(title: CharSequence, url: String, imageUrl: String? = null, target: <ERROR CLASS>, style: <ERROR CLASS>): Button
fun <T : Bus<T>> T.webUrlButton(title: CharSequence, url: String, imageUrl: String? = null, target: String? = HrefTargetType._blank.name, style: <ERROR CLASS>): Button
fun <T : Bus<T>> T.webUrlButton(title: CharSequence, url: String, imageUrl: String? = null, target: <ERROR CLASS>, style: String? = ButtonStyle.primary.name): Button
fun <T : Bus<T>> T.webUrlButton(title: CharSequence, url: String, imageUrl: String? = null, target: String? = HrefTargetType._blank.name, style: String? = ButtonStyle.primary.name): Button

webWidget

Creates a custom payload

fun <T : Bus<T>> T.webWidget(widget: WebWidget, buttons: List<Button> = emptyList()): WebMessage

withWeb

Adds a Web ConnectorMessage if the current connector is Web. You need to call BotBus.send or BotBus.end later to send this message.

fun <T : Bus<T>> T.withWeb(messageProvider: () -> WebConnectorMessage): T