// // ItemsSyncUpdate.swift // Fervor // // Created by Shadowfacts on 1/9/22. // import Foundation public struct ItemsSyncUpdate: Decodable { public let syncTimestamp: Date public let delete: [FervorID] public let upsert: [Item] public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.syncTimestamp = try container.decode(Date.self, forKey: .syncTimestamp) self.delete = try container.decode([FervorID].self, forKey: .delete) self.upsert = try container.decode([Item].self, forKey: .upsert) } private enum CodingKeys: String, CodingKey { case syncTimestamp = "sync_timestamp" case delete case upsert } }