mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
50 lines
1.2 KiB
Swift
50 lines
1.2 KiB
Swift
// Generated code. Do not modify.
|
|
|
|
import Foundation
|
|
import Serialization
|
|
import VGSL
|
|
|
|
public final class DivActionFocusElement: Sendable {
|
|
public static let type: String = "focus_element"
|
|
public let elementId: Expression<String>
|
|
|
|
public func resolveElementId(_ resolver: ExpressionResolver) -> String? {
|
|
resolver.resolveString(elementId)
|
|
}
|
|
|
|
public convenience init(dictionary: [String: Any], context: ParsingContext) throws {
|
|
self.init(
|
|
elementId: try dictionary.getExpressionField("element_id", context: context)
|
|
)
|
|
}
|
|
|
|
init(
|
|
elementId: Expression<String>
|
|
) {
|
|
self.elementId = elementId
|
|
}
|
|
}
|
|
|
|
#if DEBUG
|
|
extension DivActionFocusElement: Equatable {
|
|
public static func ==(lhs: DivActionFocusElement, rhs: DivActionFocusElement) -> Bool {
|
|
guard
|
|
lhs.elementId == rhs.elementId
|
|
else {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
}
|
|
#endif
|
|
|
|
extension DivActionFocusElement: Serializable {
|
|
@_optimize(size)
|
|
public func toDictionary() -> [String: ValidSerializationValue] {
|
|
var result: [String: ValidSerializationValue] = [:]
|
|
result["type"] = Self.type
|
|
result["element_id"] = elementId.toValidSerializationValue()
|
|
return result
|
|
}
|
|
}
|