divkit.dsl.ActionArrayRemoveValue.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-json-builder Show documentation
Show all versions of kotlin-json-builder Show documentation
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.
@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
/**
* Deletes a value from the array
*
* Can be created using the method [actionArrayRemoveValue].
*
* Required parameters: `variable_name, type, index`.
*/
@Generated
class ActionArrayRemoveValue internal constructor(
@JsonIgnore
val properties: Properties,
) : ActionTyped {
@JsonAnyGetter
internal fun getJsonProperties(): Map = properties.mergeWith(
mapOf("type" to "array_remove_value")
)
operator fun plus(additive: Properties): ActionArrayRemoveValue = ActionArrayRemoveValue(
Properties(
index = additive.index ?: properties.index,
variableName = additive.variableName ?: properties.variableName,
)
)
class Properties internal constructor(
val index: Property?,
val variableName: Property?,
) {
internal fun mergeWith(properties: Map): Map {
val result = mutableMapOf()
result.putAll(properties)
result.tryPutProperty("index", index)
result.tryPutProperty("variable_name", variableName)
return result
}
}
}
@Generated
fun DivScope.actionArrayRemoveValue(
`use named arguments`: Guard = Guard.instance,
index: Int? = null,
variableName: String? = null,
): ActionArrayRemoveValue = ActionArrayRemoveValue(
ActionArrayRemoveValue.Properties(
index = valueOrNull(index),
variableName = valueOrNull(variableName),
)
)
@Generated
fun DivScope.actionArrayRemoveValueProps(
`use named arguments`: Guard = Guard.instance,
index: Int? = null,
variableName: String? = null,
) = ActionArrayRemoveValue.Properties(
index = valueOrNull(index),
variableName = valueOrNull(variableName),
)
@Generated
fun TemplateScope.actionArrayRemoveValueRefs(
`use named arguments`: Guard = Guard.instance,
index: ReferenceProperty? = null,
variableName: ReferenceProperty? = null,
) = ActionArrayRemoveValue.Properties(
index = index,
variableName = variableName,
)
@Generated
fun ActionArrayRemoveValue.override(
`use named arguments`: Guard = Guard.instance,
index: Int? = null,
variableName: String? = null,
): ActionArrayRemoveValue = ActionArrayRemoveValue(
ActionArrayRemoveValue.Properties(
index = valueOrNull(index) ?: properties.index,
variableName = valueOrNull(variableName) ?: properties.variableName,
)
)
@Generated
fun ActionArrayRemoveValue.defer(
`use named arguments`: Guard = Guard.instance,
index: ReferenceProperty? = null,
variableName: ReferenceProperty? = null,
): ActionArrayRemoveValue = ActionArrayRemoveValue(
ActionArrayRemoveValue.Properties(
index = index ?: properties.index,
variableName = variableName ?: properties.variableName,
)
)
@Generated
fun ActionArrayRemoveValue.evaluate(
`use named arguments`: Guard = Guard.instance,
index: ExpressionProperty? = null,
variableName: ExpressionProperty? = null,
): ActionArrayRemoveValue = ActionArrayRemoveValue(
ActionArrayRemoveValue.Properties(
index = index ?: properties.index,
variableName = variableName ?: properties.variableName,
)
)
@Generated
fun ActionArrayRemoveValue.asList() = listOf(this)