mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
49 lines
1.3 KiB
Swift
49 lines
1.3 KiB
Swift
// Generated code. Do not modify.
|
|
|
|
@testable import DivKit
|
|
import Foundation
|
|
import Serialization
|
|
import VGSL
|
|
|
|
import enum DivKit.Expression
|
|
|
|
public final class EntityWithEntityProperty: Sendable {
|
|
public static let type: String = "entity_with_entity_property"
|
|
public let entity: Entity // default value: .entityWithStringEnumProperty(EntityWithStringEnumProperty(property: .value(.second)))
|
|
|
|
public convenience init(dictionary: [String: Any], context: ParsingContext) throws {
|
|
self.init(
|
|
entity: try dictionary.getOptionalField("entity", transform: { (dict: [String: Any]) in try Entity(dictionary: dict, context: context) })
|
|
)
|
|
}
|
|
|
|
init(
|
|
entity: Entity? = nil
|
|
) {
|
|
self.entity = entity ?? .entityWithStringEnumProperty(EntityWithStringEnumProperty(property: .value(.second)))
|
|
}
|
|
}
|
|
|
|
#if DEBUG
|
|
extension EntityWithEntityProperty: Equatable {
|
|
public static func ==(lhs: EntityWithEntityProperty, rhs: EntityWithEntityProperty) -> Bool {
|
|
guard
|
|
lhs.entity == rhs.entity
|
|
else {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
}
|
|
#endif
|
|
|
|
extension EntityWithEntityProperty: Serializable {
|
|
@_optimize(size)
|
|
public func toDictionary() -> [String: ValidSerializationValue] {
|
|
var result: [String: ValidSerializationValue] = [:]
|
|
result["type"] = Self.type
|
|
result["entity"] = entity.toDictionary()
|
|
return result
|
|
}
|
|
}
|