// // UnitsListModel.swift // LMS // // Created by Suraj Kumar Mandal on 06/09/22. // // let unitsList = try? newJSONDecoder().decode(UnitsList.self, from: jsonData) import Foundation // MARK: - UnitsListModel class UnitsListModel: Codable { var createdBy, createdDate, lastModifiedBy, lastModifiedDate: String? var id: Int? var academicYear, name, status: String? var intervention: Intervention? var level: UnitsLevel? var comments: String? init(createdBy: String?, createdDate: String?, lastModifiedBy: String?, lastModifiedDate: String?, id: Int?, academicYear: String?, name: String?, status: String?, intervention: Intervention?, level: UnitsLevel?, comments: String?) { self.createdBy = createdBy self.createdDate = createdDate self.lastModifiedBy = lastModifiedBy self.lastModifiedDate = lastModifiedDate self.id = id self.academicYear = academicYear self.name = name self.status = status self.intervention = intervention self.level = level self.comments = comments } } // MARK: - Intervention class Intervention: Codable { var id, incrementor: Int? var interventionId, interventionName: String? var interventionLevels: [String]? var beneficiaryIds: [Int]? var deleted, active: Bool? var status: String? var interventionSchoolMappings, mappedProgramHeads: JSONNull? init(id: Int?, incrementor: Int?, interventionId: String?, interventionName: String?, interventionLevels: [String]?, beneficiaryIds: [Int]?, deleted: Bool?, active: Bool?, status: String?, interventionSchoolMappings: JSONNull?, mappedProgramHeads: JSONNull?) { self.id = id self.incrementor = incrementor self.interventionId = interventionId self.interventionName = interventionName self.interventionLevels = interventionLevels self.beneficiaryIds = beneficiaryIds self.deleted = deleted self.active = active self.status = status self.interventionSchoolMappings = interventionSchoolMappings self.mappedProgramHeads = mappedProgramHeads } } // MARK: - Level class UnitsLevel: Codable { var id, interventionTableId: Int? var interventionLevels: String? init(id: Int?, interventionTableId: Int?, interventionLevels: String?) { self.id = id self.interventionTableId = interventionTableId self.interventionLevels = interventionLevels } }