All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.justai.jaicf.channel.yandexalice.api.model.Card.kt Maven / Gradle / Ivy

Go to download

JAICF-Kotlin Yandex Alice Channel implementation. Enables JAICF-Kotlin integration with Alice.

The newest version!
package com.justai.jaicf.channel.yandexalice.api.model

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

interface Card

@Serializable
@SerialName("BigImage")
data class Image(
    @SerialName("image_id")
    val imageId: String,
    val title: String? = null,
    val description: String? = null,
    val button: Button? = null
) : Card

@Serializable
@SerialName("ItemsList")
data class ItemsList(
    val header: Header? = null,
    val footer: Footer? = null,
    val items: MutableList = mutableListOf()
): Card {

    fun addImage(image: Image): ItemsList = apply { items.add(image) }

    @Serializable
    data class Header(val text: String? = null)

    @Serializable
    data class Footer(val text: String, val button: Button? = null)
}

@Serializable
@SerialName("ImageGallery")
data class ImageGallery(
    private val items: List
): Card




© 2015 - 2024 Weber Informatics LLC | Privacy Policy