models
KindlyEvent
data class
data class KindlyEvent(val type: KindlyEventType, val detail: KindlyEventDetail, val timestamp: Date = Date())Main event structure emitted by the Kindly SDK
Member | Declaration | Description |
|---|---|---|
KindlyEvent | constructor(type: KindlyEventType, detail: KindlyEventDetail, timestamp: Date = Date()) | |
detail | val detail: KindlyEventDetail | The event details |
timestamp | val timestamp: Date | Timestamp when the event was emitted |
type | val type: KindlyEventType | The type of event |
KindlyEventAttachment
data class
data class KindlyEventAttachment(val id: String, val name: String, val format: String, val status: String, val sender: String, val storagePath: String)Attachment data for events
Member | Declaration | Description |
|---|---|---|
KindlyEventAttachment | constructor(id: String, name: String, format: String, status: String, sender: String, storagePath: String) | |
format | val format: String | Attachment format |
id | val id: String | Attachment ID |
name | val name: String | Attachment name |
sender | val sender: String | Attachment sender |
status | val status: String | Attachment status |
storagePath | val storagePath: String | Storage path |
KindlyEventButton
data class
data class KindlyEventButton(val id: String? = null, val type: String, val label: String, val value: String? = null, val index: Int? = null, val hasBeenSelected: Boolean = false, val context: Map<String, Any>? = null)Button data for events
Member | Declaration | Description |
|---|---|---|
KindlyEventButton | constructor(id: String? = null, type: String, label: String, value: String? = null, index: Int? = null, hasBeenSelected: Boolean = false, context: Map<String, Any>? = null) | |
context | val context: Map<String, Any>? | Button context data |
hasBeenSelected | val hasBeenSelected: Boolean | Whether the button has been selected |
id | val id: String? | Button ID |
index | val index: Int? | Button index |
label | val label: String | Button label text |
type | val type: String | Button type |
value | val value: String? | Button value |
KindlyEventDetail
sealed class
sealed class KindlyEventDetailEvent details that can be associated with different event types
KindlyEventDetail.ButtonClick
data class
data class ButtonClick(val button: KindlyEventButton, val buttonType: String, val chatLog: List<KindlyEventMessage>, val lastMessage: KindlyEventMessage) : KindlyEventDetailButton click event
Member | Declaration | Description |
|---|---|---|
ButtonClick | constructor(button: KindlyEventButton, buttonType: String, chatLog: List<KindlyEventMessage>, lastMessage: KindlyEventMessage) | |
button | val button: KindlyEventButton | |
buttonType | val buttonType: String | |
chatLog | val chatLog: List<KindlyEventMessage> | |
lastMessage | val lastMessage: KindlyEventMessage | |
KindlyEventDetail.GlobalIcon
data class
data class GlobalIcon(val action: KindlyEventGlobalIcon) : KindlyEventDetailGlobal icon event
Member | Declaration | Description |
|---|---|---|
GlobalIcon | constructor(action: KindlyEventGlobalIcon) | |
action | val action: KindlyEventGlobalIcon | |
KindlyEventDetail.Load
data class
data class Load(val settings: KindlyEventSettings) : KindlyEventDetailSettings loaded event
Member | Declaration | Description |
|---|---|---|
Load | constructor(settings: KindlyEventSettings) | |
settings | val settings: KindlyEventSettings | |
KindlyEventDetail.Message
data class
data class Message(val newMessage: KindlyEventMessage, val chatLog: List<KindlyEventMessage>) : KindlyEventDetailMessage event with new message and chat log
Member | Declaration | Description |
|---|---|---|
Message | constructor(newMessage: KindlyEventMessage, chatLog: List<KindlyEventMessage>) | |
chatLog | val chatLog: List<KindlyEventMessage> | |
newMessage | val newMessage: KindlyEventMessage | |
KindlyEventDetail.State
data class
data class State(val state: KindlyEventState) : KindlyEventDetailState change event
Member | Declaration | Description |
|---|---|---|
State | constructor(state: KindlyEventState) | |
state | val state: KindlyEventState | |
KindlyEventDetail.UI
data class
data class UI(val action: KindlyEventUIAction) : KindlyEventDetailUI action event
Member | Declaration | Description |
|---|---|---|
UI | constructor(action: KindlyEventUIAction) | |
action | val action: KindlyEventUIAction | |
KindlyEventExchangeType
enum
enum KindlyEventExchangeType : Enum<KindlyEventExchangeType>Exchange types for events
Member | Declaration | Description |
|---|---|---|
DIALOGUE | DIALOGUE | |
FALLBACK | FALLBACK | |
GREETING | GREETING | |
SYSTEM_DIALOGUE | SYSTEM_DIALOGUE | |
USER_SAYS | USER_SAYS | |
entries | val entries: EnumEntries<KindlyEventExchangeType> | Returns a representation of an immutable list of all enum entries, in the order they're declared. This method may be used to iterate over the enum entries. |
value | val value: String | |
valueOf | fun valueOf(value: String): KindlyEventExchangeType | Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) Throws - kotlin.IllegalArgumentException: if this enum type has no constant with the specified name |
values | fun values(): Array<KindlyEventExchangeType> | Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants. |
KindlyEventGlobalIcon
data class
data class KindlyEventGlobalIcon(val type: String, val source: String = "user", val value: Map<String, Any>? = null)Global icon action data for events
Member | Declaration | Description |
|---|---|---|
KindlyEventGlobalIcon | constructor(type: String, source: String = "user", value: Map<String, Any>? = null) | |
source | val source: String | Action source |
type | val type: String | Action type |
value | val value: Map<String, Any>? | Additional value data |
KindlyEventImage
data class
data class KindlyEventImage(val url: String, val altText: String? = null, val id: String? = null)Image data for events
Member | Declaration | Description |
|---|---|---|
KindlyEventImage | constructor(url: String, altText: String? = null, id: String? = null) | |
altText | val altText: String? | Alt text for accessibility |
id | val id: String? | Image ID |
url | val url: String | Image URL |
KindlyEventLanguage
data class
data class KindlyEventLanguage(val code: String, val name: String, val isDefault: Boolean = false)Language data for events
Member | Declaration | Description |
|---|---|---|
KindlyEventLanguage | constructor(code: String, name: String, isDefault: Boolean = false) | |
code | val code: String | Language code (e.g., "en", "es") |
isDefault | val isDefault: Boolean | Whether this is the default language |
name | val name: String | Language name (e.g., "English", "Spanish") |
KindlyEventMessage
data class
data class KindlyEventMessage(val id: String, val chatId: String? = null, val text: String? = null, val sender: KindlyEventMessageSender, val created: Date? = null, val isFromUser: Boolean, val exchangeID: String? = null, val videoSource: String? = null, val exchangeType: KindlyEventExchangeType? = null, val buttons: List<KindlyEventButton> = emptyList(), val images: List<KindlyEventImage> = emptyList(), val attachments: List<KindlyEventAttachment> = emptyList())Message data for events
Member | Declaration | Description |
|---|---|---|
KindlyEventMessage | constructor(id: String, chatId: String? = null, text: String? = null, sender: KindlyEventMessageSender, created: Date? = null, isFromUser: Boolean, exchangeID: String? = null, videoSource: String? = null, exchangeType: KindlyEventExchangeType? = null, buttons: List<KindlyEventButton> = emptyList(), images: List<KindlyEventImage> = emptyList(), attachments: List<KindlyEventAttachment> = emptyList()) | |
attachments | val attachments: List<KindlyEventAttachment> | Message attachments if any |
buttons | val buttons: List<KindlyEventButton> | Message buttons if any |
chatId | val chatId: String? | The chat/session ID this message belongs to (server chat_id) |
created | val created: Date? | Message creation timestamp |
exchangeID | val exchangeID: String? | Exchange ID if applicable |
exchangeType | val exchangeType: KindlyEventExchangeType? | Exchange type if applicable |
id | val id: String | Message ID |
images | val images: List<KindlyEventImage> | Message images if any |
isFromUser | val isFromUser: Boolean | Whether the message is from the user |
sender | val sender: KindlyEventMessageSender | Message sender type |
text | val text: String? | Message text content |
videoSource | val videoSource: String? | Video source URL if applicable |
KindlyEventMessageSender
enum
enum KindlyEventMessageSender : Enum<KindlyEventMessageSender>Message sender types for events
Member | Declaration | Description |
|---|---|---|
AGENT | AGENT | |
BOT | BOT | |
SYSTEM | SYSTEM | |
USER | USER | |
UNKNOWN | UNKNOWN | |
entries | val entries: EnumEntries<KindlyEventMessageSender> | Returns a representation of an immutable list of all enum entries, in the order they're declared. This method may be used to iterate over the enum entries. |
value | val value: String | |
valueOf | fun valueOf(value: String): KindlyEventMessageSender | Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) Throws - kotlin.IllegalArgumentException: if this enum type has no constant with the specified name |
values | fun values(): Array<KindlyEventMessageSender> | Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants. |
KindlyEventSettings
data class
data class KindlyEventSettings(val name: String, val id: String, val languages: List<KindlyEventLanguage>, val style: KindlyEventStyle)Settings data for load events
Member | Declaration | Description |
|---|---|---|
KindlyEventSettings | constructor(name: String, id: String, languages: List<KindlyEventLanguage>, style: KindlyEventStyle) | |
id | val id: String | Settings ID |
languages | val languages: List<KindlyEventLanguage> | Available languages |
name | val name: String | Settings name |
style | val style: KindlyEventStyle | Style configuration |
KindlyEventState
data class
data class KindlyEventState(val isChatDisplayed: Boolean, val isStarted: Boolean, val isSocketConnected: Boolean, val isConnected: Boolean, val connectionState: String)State data for events
Member | Declaration | Description |
|---|---|---|
KindlyEventState | constructor(isChatDisplayed: Boolean, isStarted: Boolean, isSocketConnected: Boolean, isConnected: Boolean, connectionState: String) | |
connectionState | val connectionState: String | Current connection state as string |
isChatDisplayed | val isChatDisplayed: Boolean | Whether the chat is currently displayed |
isConnected | val isConnected: Boolean | Whether the SDK is fully connected (started + socket connected) |
isSocketConnected | val isSocketConnected: Boolean | Whether the socket is connected to Pusher |
isStarted | val isStarted: Boolean | Whether the SDK has been started |
KindlyEventStyle
data class
data class KindlyEventStyle(val background: String? = null, val buttonBackground: String? = null, val buttonText: String? = null, val headerBackground: String? = null, val headerText: String? = null, val inputBackground: String? = null, val inputText: String? = null, val userMessageBackground: String? = null, val userMessageTextColor: String? = null, val botMessageBackground: String? = null, val botMessageTextColor: String? = null)Style data for events
Member | Declaration | Description |
|---|---|---|
KindlyEventStyle | constructor(background: String? = null, buttonBackground: String? = null, buttonText: String? = null, headerBackground: String? = null, headerText: String? = null, inputBackground: String? = null, inputText: String? = null, userMessageBackground: String? = null, userMessageTextColor: String? = null, botMessageBackground: String? = null, botMessageTextColor: String? = null) | |
background | val background: String? | Background color in hex format |
botMessageBackground | val botMessageBackground: String? | Bot message background color in hex format |
botMessageTextColor | val botMessageTextColor: String? | Bot message text color in hex format |
buttonBackground | val buttonBackground: String? | Button background color in hex format |
buttonText | val buttonText: String? | Button text color in hex format |
headerBackground | val headerBackground: String? | Header background color in hex format |
headerText | val headerText: String? | Header text color in hex format |
inputBackground | val inputBackground: String? | Input background color in hex format |
inputText | val inputText: String? | Input text color in hex format |
userMessageBackground | val userMessageBackground: String? | User message background color in hex format |
userMessageTextColor | val userMessageTextColor: String? | User message text color in hex format |
KindlyEventType
enum
enum KindlyEventType : Enum<KindlyEventType>Types of events that can be emitted by the Kindly SDK
Member | Declaration | Description |
|---|---|---|
LOAD | LOAD | Settings loaded event |
MESSAGE | MESSAGE | Message event |
BUTTON_CLICK | BUTTON_CLICK | Button click event |
UI | UI | UI action event |
GLOBAL_ICON | GLOBAL_ICON | Global icon event |
STATE | STATE | State change event |
entries | val entries: EnumEntries<KindlyEventType> | Returns a representation of an immutable list of all enum entries, in the order they're declared. This method may be used to iterate over the enum entries. |
value | val value: String | |
valueOf | fun valueOf(value: String): KindlyEventType | Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) Throws - kotlin.IllegalArgumentException: if this enum type has no constant with the specified name |
values | fun values(): Array<KindlyEventType> | Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants. |
KindlyEventUIAction
data class
data class KindlyEventUIAction(val type: KindlyUIActionType, val source: String = "user", val chatId: String, val value: Map<String, Any>? = null, val feedbackType: String? = null, val feedbackValue: Map<String, Any>? = null, val languageCode: String? = null, val languageName: String? = null, val previousLanguageCode: String? = null, val previousLanguageName: String? = null, val nextPage: String? = null)UI action data for events
Member | Declaration | Description |
|---|---|---|
KindlyEventUIAction | constructor(type: KindlyUIActionType, source: String = "user", chatId: String, value: Map<String, Any>? = null, feedbackType: String? = null, feedbackValue: Map<String, Any>? = null, languageCode: String? = null, languageName: String? = null, previousLanguageCode: String? = null, previousLanguageName: String? = null, nextPage: String? = null) | |
chatId | val chatId: String | Chat ID |
feedbackType | val feedbackType: String? | Feedback type if applicable |
feedbackValue | val feedbackValue: Map<String, Any>? | Feedback value if applicable |
languageCode | val languageCode: String? | Language code for language change events |
languageName | val languageName: String? | Language name for language change events |
nextPage | val nextPage: String? | Next page for navigation events |
previousLanguageCode | val previousLanguageCode: String? | Previous language code for language change events |
previousLanguageName | val previousLanguageName: String? | Previous language name for language change events |
source | val source: String | Action source (user or programmatic) |
type | val type: KindlyUIActionType | Action type |
value | val value: Map<String, Any>? | Additional value data |
KindlyUIActionType
enum
enum KindlyUIActionType : Enum<KindlyUIActionType>Types of UI actions that can be performed
Member | Declaration | Description |
|---|---|---|
OPEN_CHAT_BUBBLE | OPEN_CHAT_BUBBLE | Open chat bubble |
CLOSE_CHAT_BUBBLE | CLOSE_CHAT_BUBBLE | Close chat bubble |
END_CHAT | END_CHAT | End chat |
RESTART_CHAT | RESTART_CHAT | Restart chat |
DOWNLOAD_CHAT | DOWNLOAD_CHAT | Download chat |
DELETE_CHAT | DELETE_CHAT | Delete chat |
CHANGE_LANGUAGE | CHANGE_LANGUAGE | Change language |
SHOW_FEEDBACK | SHOW_FEEDBACK | Show feedback |
SUBMIT_FEEDBACK | SUBMIT_FEEDBACK | Submit feedback |
DISMISS_FEEDBACK | DISMISS_FEEDBACK | Dismiss feedback |
entries | val entries: EnumEntries<KindlyUIActionType> | Returns a representation of an immutable list of all enum entries, in the order they're declared. This method may be used to iterate over the enum entries. |
value | val value: String | |
valueOf | fun valueOf(value: String): KindlyUIActionType | Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) Throws - kotlin.IllegalArgumentException: if this enum type has no constant with the specified name |
values | fun values(): Array<KindlyUIActionType> | Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants. |