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

com.yandex.div.dsl.model.DivTrigger.kt Maven / Gradle / Ivy

Go to download

DivKit is an open source Server-Driven UI (SDUI) framework. SDUI is a an emerging technique that leverage the server to build the user interfaces of their mobile app.

There is a newer version: 30.19.0
Show newest version
// Generated code. Do not modify.

package com.yandex.div.dsl.model

import java.net.URI
import com.fasterxml.jackson.annotation.*
import com.yandex.div.dsl.*
import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*

class DivTrigger internal constructor(
    @JsonIgnore val actions: Property>?,
    @JsonIgnore val condition: Property?,
    @JsonIgnore val mode: Property?,
) {

    @JsonAnyGetter
    internal fun properties(): Map {
        return propertyMapOf(
            "actions" to actions,
            "condition" to condition,
            "mode" to mode,
        )
    }

    enum class Mode(@JsonValue val value: String) {
        ON_CONDITION("on_condition"),
        ON_VARIABLE("on_variable"),
    }
}

fun  TemplateContext.divTrigger(): LiteralProperty {
    return value(DivTrigger(
        actions = null,
        condition = null,
        mode = null,
    ))
}

fun  TemplateContext.divTrigger(
    actions: Property>? = null,
    condition: Property? = null,
    mode: Property? = null,
): LiteralProperty {
    return value(DivTrigger(
        actions = actions,
        condition = condition,
        mode = mode,
    ))
}

fun  TemplateContext.divTrigger(
    actions: List? = null,
    condition: BoolInt? = null,
    mode: DivTrigger.Mode? = null,
): LiteralProperty {
    return value(DivTrigger(
        actions = optionalValue(actions),
        condition = optionalValue(condition),
        mode = optionalValue(mode),
    ))
}

fun CardContext.divTrigger(
    actions: ValueProperty>,
    condition: ValueProperty,
    mode: ValueProperty? = null,
): DivTrigger {
    return DivTrigger(
        actions = actions,
        condition = condition,
        mode = mode,
    )
}

fun CardContext.divTrigger(
    actions: List,
    condition: BoolInt,
    mode: DivTrigger.Mode? = null,
): DivTrigger {
    return DivTrigger(
        actions = value(actions),
        condition = value(condition),
        mode = optionalValue(mode),
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy