mirror of
https://github.com/divkit/divkit.git
synced 2026-05-07 20:02:32 +00:00
c027fce9e9
commit_hash:bf241c3958d26bad19ee35a08ae65b1c393de58e
58 lines
1.5 KiB
Swift
58 lines
1.5 KiB
Swift
// Generated code. Do not modify.
|
|
|
|
import Foundation
|
|
import Serialization
|
|
import VGSL
|
|
|
|
public final class DivActionArrayInsertValue: Sendable {
|
|
public static let type: String = "array_insert_value"
|
|
public let index: Expression<Int>?
|
|
public let value: DivTypedValue
|
|
public let variableName: Expression<String>
|
|
|
|
public func resolveIndex(_ resolver: ExpressionResolver) -> Int? {
|
|
resolver.resolveNumeric(index)
|
|
}
|
|
|
|
public func resolveVariableName(_ resolver: ExpressionResolver) -> String? {
|
|
resolver.resolveString(variableName)
|
|
}
|
|
|
|
init(
|
|
index: Expression<Int>? = nil,
|
|
value: DivTypedValue,
|
|
variableName: Expression<String>
|
|
) {
|
|
self.index = index
|
|
self.value = value
|
|
self.variableName = variableName
|
|
}
|
|
}
|
|
|
|
#if DEBUG
|
|
extension DivActionArrayInsertValue: Equatable {
|
|
public static func ==(lhs: DivActionArrayInsertValue, rhs: DivActionArrayInsertValue) -> Bool {
|
|
guard
|
|
lhs.index == rhs.index,
|
|
lhs.value == rhs.value,
|
|
lhs.variableName == rhs.variableName
|
|
else {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
}
|
|
#endif
|
|
|
|
extension DivActionArrayInsertValue: Serializable {
|
|
@_optimize(size)
|
|
public func toDictionary() -> [String: ValidSerializationValue] {
|
|
var result: [String: ValidSerializationValue] = [:]
|
|
result["type"] = Self.type
|
|
result["index"] = index?.toValidSerializationValue()
|
|
result["value"] = value.toDictionary()
|
|
result["variable_name"] = variableName.toValidSerializationValue()
|
|
return result
|
|
}
|
|
}
|