Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
4.6 kB
4
Indexable
Never
package br.com.santander.modulo.dynamicmenu.model

import android.os.Parcelable
import com.google.gson.annotations.SerializedName
import kotlinx.parcelize.Parcelize

abstract class Validatable {
    abstract val toggle: String?
    abstract val validate: List<Map<String, String>>?
}

data class DynamicMenuModel(
    @SerializedName("header")
    val header: DynamicMenuHeader,
    @SerializedName("sections")
    val sections: List<DynamicMenuSection>
)

data class DynamicMenuHeader(
    @SerializedName("firstLabel")
    val firstLabel: String,
    @SerializedName("colorFirstLabel")
    val colorFirstLabel: String?,
    @SerializedName("secondLabel")
    val secondLabel: String,
    @SerializedName("colorSecondLabel")
    val colorSecondLabel: String?,
    @SerializedName("icon")
    val icon: String?,
    @SerializedName("colorIcon")
    val colorIcon: String?,
    @SerializedName("action")
    val action: String?,
    @SerializedName("button")
    val button: DynamicMenuContent,
    @SerializedName("searchBar")
    val searchBar: DynamicMenuSearchBar?
)

@Parcelize
data class DynamicMenuSearchBar(
    @SerializedName("searchIcon")
    val searchIcon: String?,
    @SerializedName("clearIcon")
    val clearIcon: String?,
    @SerializedName("hint")
    val hint: String?,
    @SerializedName("toggle")
    override val toggle: String?,
    @SerializedName("accessibility")
    val accessibility: String?,
    @SerializedName("colorBackground")
    val colorBackground: String?,
    @SerializedName("colorText")
    val colorText: String?,
    @SerializedName("emptyState")
    val emptyState: DynamicMenuSearchBarEmptyState?,
    @SerializedName("validate")
    override val validate: List<Map<String, String>>?
): Parcelable, Validatable()

@Parcelize
data class DynamicMenuSearchBarEmptyState(
    @SerializedName("icon")
    val icon: String?,
    @SerializedName("colorIcon")
    val colorIcon: String?,
    @SerializedName("description")
    val description: String?,
    @SerializedName("link")
    val link: String?,
    @SerializedName("accessibility")
    val accessibility: String?,
    @SerializedName("action")
    val action: String?,
    @SerializedName("colorBackground")
    val colorBackground: String?
): Parcelable

@Parcelize
data class DynamicMenuUnavailability(
    @SerializedName("title")
    var title: String?,
    @SerializedName("base64Image")
    val base64Image: String?,
    @SerializedName("errorMessage")
    val errorMessage: String?,
    @SerializedName("procedure")
    val procedure: String?,
    @SerializedName("textButton")
    val textButton: String?,
    @SerializedName("actionButton")
    val actionButton: String?,
    @SerializedName("textLink")
    val textLink: String?,
    @SerializedName("actionLink")
    val actionLink: String?
) : Parcelable

@Parcelize
data class DynamicMenuSection(
    @SerializedName("title")
    var title: String?,
    @SerializedName("content")
    val content: List<DynamicMenuContent>?,
    @SerializedName("toggle")
    override val toggle: String?,
    @SerializedName("validate")
    override val validate: List<Map<String, String>>?
) : Parcelable, Validatable()

@Parcelize
data class DynamicMenuContent(
    @SerializedName("id")
    var id: String?,
    @SerializedName("title")
    var title: String?,
    @SerializedName("name")
    val name: String,
    @SerializedName("colorText")
    val colorText: String?,
    @SerializedName("badgeNotification")
    val badgeNotification: Boolean = false,
    @SerializedName("description")
    var description: String?,
    @SerializedName("highlight")
    val highlight: Boolean = false,
    @SerializedName("keep")
    val keep: Boolean = false,
    @SerializedName("icon")
    var icon: String?,
    @SerializedName("colorIcon")
    val colorIcon: String?,
    @SerializedName("accessibility")
    val accessibility: String?,
    @SerializedName("analytics")
    val analytics: List<Map<String, String>?>?,
    @SerializedName("tag")
    val tag: String?,
    @SerializedName("action")
    val action: String?,
    @SerializedName("badge")
    val badge: Boolean = false,
    @SerializedName("toggle")
    override val toggle: String?,
    @SerializedName("validate")
    override val validate: List<Map<String, String>>?,
    @SerializedName("separator")
    var separator: Boolean = false,
    @SerializedName("isUnavailable")
    var isUnavailable: Boolean = false,
    @SerializedName("children")
    val children: List<DynamicMenuSection>?,
    @SerializedName("unavailability")
    val unavailability: DynamicMenuUnavailability?,
) : Parcelable, Validatable()