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

divkit.dsl.ActionShowTooltip.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.32.0
Show newest version
@file:Suppress(
    "unused",
    "UNUSED_PARAMETER",
)

package divkit.dsl

import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonIgnore
import com.fasterxml.jackson.annotation.JsonValue
import divkit.dsl.annotation.*
import divkit.dsl.core.*
import divkit.dsl.scope.*
import kotlin.Any
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.collections.Map

/**
 * Shows tooltip.
 * 
 * Can be created using the method [actionShowTooltip].
 * 
 * Required parameters: `type, id`.
 */
@Generated
class ActionShowTooltip internal constructor(
    @JsonIgnore
    val properties: Properties,
) : ActionTyped {
    @JsonAnyGetter
    internal fun getJsonProperties(): Map = properties.mergeWith(
        mapOf("type" to "show_tooltip")
    )

    operator fun plus(additive: Properties): ActionShowTooltip = ActionShowTooltip(
        Properties(
            id = additive.id ?: properties.id,
            multiple = additive.multiple ?: properties.multiple,
        )
    )

    class Properties internal constructor(
        /**
         * Tooltip identifier.
         */
        val id: Property?,
        /**
         * Defines whether tooltip can be shown again after being closed.
         */
        val multiple: Property?,
    ) {
        internal fun mergeWith(properties: Map): Map {
            val result = mutableMapOf()
            result.putAll(properties)
            result.tryPutProperty("id", id)
            result.tryPutProperty("multiple", multiple)
            return result
        }
    }
}

/**
 * @param id Tooltip identifier.
 * @param multiple Defines whether tooltip can be shown again after being closed.
 */
@Generated
fun DivScope.actionShowTooltip(
    `use named arguments`: Guard = Guard.instance,
    id: String? = null,
    multiple: Boolean? = null,
): ActionShowTooltip = ActionShowTooltip(
    ActionShowTooltip.Properties(
        id = valueOrNull(id),
        multiple = valueOrNull(multiple),
    )
)

/**
 * @param id Tooltip identifier.
 * @param multiple Defines whether tooltip can be shown again after being closed.
 */
@Generated
fun DivScope.actionShowTooltipProps(
    `use named arguments`: Guard = Guard.instance,
    id: String? = null,
    multiple: Boolean? = null,
) = ActionShowTooltip.Properties(
    id = valueOrNull(id),
    multiple = valueOrNull(multiple),
)

/**
 * @param id Tooltip identifier.
 * @param multiple Defines whether tooltip can be shown again after being closed.
 */
@Generated
fun TemplateScope.actionShowTooltipRefs(
    `use named arguments`: Guard = Guard.instance,
    id: ReferenceProperty? = null,
    multiple: ReferenceProperty? = null,
) = ActionShowTooltip.Properties(
    id = id,
    multiple = multiple,
)

/**
 * @param id Tooltip identifier.
 * @param multiple Defines whether tooltip can be shown again after being closed.
 */
@Generated
fun ActionShowTooltip.override(
    `use named arguments`: Guard = Guard.instance,
    id: String? = null,
    multiple: Boolean? = null,
): ActionShowTooltip = ActionShowTooltip(
    ActionShowTooltip.Properties(
        id = valueOrNull(id) ?: properties.id,
        multiple = valueOrNull(multiple) ?: properties.multiple,
    )
)

/**
 * @param id Tooltip identifier.
 * @param multiple Defines whether tooltip can be shown again after being closed.
 */
@Generated
fun ActionShowTooltip.defer(
    `use named arguments`: Guard = Guard.instance,
    id: ReferenceProperty? = null,
    multiple: ReferenceProperty? = null,
): ActionShowTooltip = ActionShowTooltip(
    ActionShowTooltip.Properties(
        id = id ?: properties.id,
        multiple = multiple ?: properties.multiple,
    )
)

/**
 * @param id Tooltip identifier.
 * @param multiple Defines whether tooltip can be shown again after being closed.
 */
@Generated
fun ActionShowTooltip.evaluate(
    `use named arguments`: Guard = Guard.instance,
    id: ExpressionProperty? = null,
    multiple: ExpressionProperty? = null,
): ActionShowTooltip = ActionShowTooltip(
    ActionShowTooltip.Properties(
        id = id ?: properties.id,
        multiple = multiple ?: properties.multiple,
    )
)

@Generated
fun ActionShowTooltip.asList() = listOf(this)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy