mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
46 lines
1.1 KiB
Swift
46 lines
1.1 KiB
Swift
// Generated code. Do not modify.
|
|
|
|
import CommonCore
|
|
import Foundation
|
|
import Serialization
|
|
|
|
public final class EntityWithRawArray: @unchecked Sendable {
|
|
public static let type: String = "entity_with_raw_array"
|
|
public let array: Expression<[Any]>
|
|
|
|
public func resolveArray(_ resolver: ExpressionResolver) -> [Any]? {
|
|
resolver.resolveArray(array)
|
|
}
|
|
|
|
public convenience init(dictionary: [String: Any], context: ParsingContext) throws {
|
|
self.init(
|
|
array: try dictionary.getExpressionField("array", context: context)
|
|
)
|
|
}
|
|
|
|
init(
|
|
array: Expression<[Any]>
|
|
) {
|
|
self.array = array
|
|
}
|
|
}
|
|
|
|
#if DEBUG
|
|
// WARNING: this == is incomplete because of [Any] in class fields
|
|
extension EntityWithRawArray: Equatable {
|
|
public static func ==(lhs: EntityWithRawArray, rhs: EntityWithRawArray) -> Bool {
|
|
return true
|
|
}
|
|
}
|
|
#endif
|
|
|
|
extension EntityWithRawArray: Serializable {
|
|
@_optimize(size)
|
|
public func toDictionary() -> [String: ValidSerializationValue] {
|
|
var result: [String: ValidSerializationValue] = [:]
|
|
result["type"] = Self.type
|
|
result["array"] = array.toValidSerializationValue()
|
|
return result
|
|
}
|
|
}
|