mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
24 lines
451 B
Swift
24 lines
451 B
Swift
import Serialization
|
|
|
|
struct JSONPayload: Deserializable {
|
|
enum `Type`: String {
|
|
case json
|
|
}
|
|
|
|
struct Message: Deserializable {
|
|
let json: [String: Any]
|
|
|
|
init(dictionary: [String: Any]) throws {
|
|
json = try dictionary.getField("json")
|
|
}
|
|
}
|
|
|
|
let type: `Type`
|
|
let message: Message
|
|
|
|
init(dictionary: [String: Any]) throws {
|
|
type = try dictionary.getField("type")
|
|
message = try dictionary.getField("message")
|
|
}
|
|
}
|