Files
divkit/client/ios/DivKitTests/Entities/generated_sources/EntityWithOptionalStringEnumProperty.swift
feldspar e234cd83fa Added untyped template resolver
commit_hash:299c999f2d6caad74d8568059e890770d7a6b1f2
2026-02-13 12:08:22 +03:00

59 lines
1.5 KiB
Swift

// Generated code. Do not modify.
@testable import DivKit
import Foundation
import Serialization
import VGSL
import enum DivKit.Expression
public final class EntityWithOptionalStringEnumProperty: Sendable {
@frozen
public enum Property: String, CaseIterable, Sendable {
case first = "first"
case second = "second"
}
public static let type: String = "entity_with_optional_string_enum_property"
public let property: Expression<Property>?
public func resolveProperty(_ resolver: ExpressionResolver) -> Property? {
resolver.resolveEnum(property)
}
public convenience init(dictionary: [String: Any], context: ParsingContext) throws {
self.init(
property: try dictionary.getOptionalExpressionField("property", context: context)
)
}
init(
property: Expression<Property>? = nil
) {
self.property = property
}
}
#if DEBUG
extension EntityWithOptionalStringEnumProperty: Equatable {
public static func ==(lhs: EntityWithOptionalStringEnumProperty, rhs: EntityWithOptionalStringEnumProperty) -> Bool {
guard
lhs.property == rhs.property
else {
return false
}
return true
}
}
#endif
extension EntityWithOptionalStringEnumProperty: Serializable {
@_optimize(size)
public func toDictionary() -> [String: ValidSerializationValue] {
var result: [String: ValidSerializationValue] = [:]
result["type"] = Self.type
result["property"] = property?.toValidSerializationValue()
return result
}
}