AddressManagerListModel.swift 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. //
  2. // AddressManagerListModel.swift
  3. // Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport
  4. import Foundation
  5. import ObjectMapper
  6. class AddressManagerListModel : NSObject, NSCoding, Mappable{
  7. var expressAddress : [ExpressAddresModel]?
  8. var selfAddress : [SelfAddresModel]?
  9. class func newInstance(map: Map) -> Mappable?{
  10. return AddressManagerListModel()
  11. }
  12. required init?(map: Map){}
  13. private override init(){}
  14. func mapping(map: Map)
  15. {
  16. expressAddress <- map["expressAddress"]
  17. selfAddress <- map["selfAddress"]
  18. }
  19. /**
  20. * NSCoding required initializer.
  21. * Fills the data from the passed decoder
  22. */
  23. @objc required init(coder aDecoder: NSCoder)
  24. {
  25. expressAddress = aDecoder.decodeObject(forKey: "expressAddress") as? [ExpressAddresModel]
  26. selfAddress = aDecoder.decodeObject(forKey: "selfAddress") as? [SelfAddresModel]
  27. }
  28. /**
  29. * NSCoding required method.
  30. * Encodes mode properties into the decoder
  31. */
  32. @objc func encode(with aCoder: NSCoder)
  33. {
  34. if expressAddress != nil{
  35. aCoder.encode(expressAddress, forKey: "expressAddress")
  36. }
  37. if selfAddress != nil{
  38. aCoder.encode(selfAddress, forKey: "selfAddress")
  39. }
  40. }
  41. }
  42. class ExpressAddresModel : NSObject, NSCoding, Mappable{
  43. var address : String?
  44. var addressType : Int?
  45. var areaId : Int?
  46. var areaName : String?
  47. var cityId : Int?
  48. var cityName : String?
  49. var contactMobile : String?
  50. var contactName : String?
  51. var createdAt : String?
  52. var deletedAt : String?
  53. var id : Int?
  54. var isDefault : Int?
  55. var pickupNodeId : Int?
  56. var provinceId : Int?
  57. var provinceName : String?
  58. var uid : Int?
  59. var updatedAt : String?
  60. var zipcode : Int?
  61. class func newInstance(map: Map) -> Mappable?{
  62. return ExpressAddresModel()
  63. }
  64. required init?(map: Map){}
  65. private override init(){}
  66. func mapping(map: Map)
  67. {
  68. address <- map["address"]
  69. addressType <- map["address_type"]
  70. areaId <- map["area_id"]
  71. areaName <- map["area_name"]
  72. cityId <- map["city_id"]
  73. cityName <- map["city_name"]
  74. contactMobile <- map["contact_mobile"]
  75. contactName <- map["contact_name"]
  76. createdAt <- map["created_at"]
  77. deletedAt <- map["deleted_at"]
  78. id <- map["id"]
  79. isDefault <- map["is_default"]
  80. pickupNodeId <- map["pickup_node_id"]
  81. provinceId <- map["province_id"]
  82. provinceName <- map["province_name"]
  83. uid <- map["uid"]
  84. updatedAt <- map["updated_at"]
  85. zipcode <- map["zipcode"]
  86. }
  87. /**
  88. * NSCoding required initializer.
  89. * Fills the data from the passed decoder
  90. */
  91. @objc required init(coder aDecoder: NSCoder)
  92. {
  93. address = aDecoder.decodeObject(forKey: "address") as? String
  94. addressType = aDecoder.decodeObject(forKey: "address_type") as? Int
  95. areaId = aDecoder.decodeObject(forKey: "area_id") as? Int
  96. areaName = aDecoder.decodeObject(forKey: "area_name") as? String
  97. cityId = aDecoder.decodeObject(forKey: "city_id") as? Int
  98. cityName = aDecoder.decodeObject(forKey: "city_name") as? String
  99. contactMobile = aDecoder.decodeObject(forKey: "contact_mobile") as? String
  100. contactName = aDecoder.decodeObject(forKey: "contact_name") as? String
  101. createdAt = aDecoder.decodeObject(forKey: "created_at") as? String
  102. deletedAt = aDecoder.decodeObject(forKey: "deleted_at") as? String
  103. id = aDecoder.decodeObject(forKey: "id") as? Int
  104. isDefault = aDecoder.decodeObject(forKey: "is_default") as? Int
  105. pickupNodeId = aDecoder.decodeObject(forKey: "pickup_node_id") as? Int
  106. provinceId = aDecoder.decodeObject(forKey: "province_id") as? Int
  107. provinceName = aDecoder.decodeObject(forKey: "province_name") as? String
  108. uid = aDecoder.decodeObject(forKey: "uid") as? Int
  109. updatedAt = aDecoder.decodeObject(forKey: "updated_at") as? String
  110. zipcode = aDecoder.decodeObject(forKey: "zipcode") as? Int
  111. }
  112. /**
  113. * NSCoding required method.
  114. * Encodes mode properties into the decoder
  115. */
  116. @objc func encode(with aCoder: NSCoder)
  117. {
  118. if address != nil{
  119. aCoder.encode(address, forKey: "address")
  120. }
  121. if addressType != nil{
  122. aCoder.encode(addressType, forKey: "address_type")
  123. }
  124. if areaId != nil{
  125. aCoder.encode(areaId, forKey: "area_id")
  126. }
  127. if areaName != nil{
  128. aCoder.encode(areaName, forKey: "area_name")
  129. }
  130. if cityId != nil{
  131. aCoder.encode(cityId, forKey: "city_id")
  132. }
  133. if cityName != nil{
  134. aCoder.encode(cityName, forKey: "city_name")
  135. }
  136. if contactMobile != nil{
  137. aCoder.encode(contactMobile, forKey: "contact_mobile")
  138. }
  139. if contactName != nil{
  140. aCoder.encode(contactName, forKey: "contact_name")
  141. }
  142. if createdAt != nil{
  143. aCoder.encode(createdAt, forKey: "created_at")
  144. }
  145. if deletedAt != nil{
  146. aCoder.encode(deletedAt, forKey: "deleted_at")
  147. }
  148. if id != nil{
  149. aCoder.encode(id, forKey: "id")
  150. }
  151. if isDefault != nil{
  152. aCoder.encode(isDefault, forKey: "is_default")
  153. }
  154. if pickupNodeId != nil{
  155. aCoder.encode(pickupNodeId, forKey: "pickup_node_id")
  156. }
  157. if provinceId != nil{
  158. aCoder.encode(provinceId, forKey: "province_id")
  159. }
  160. if provinceName != nil{
  161. aCoder.encode(provinceName, forKey: "province_name")
  162. }
  163. if uid != nil{
  164. aCoder.encode(uid, forKey: "uid")
  165. }
  166. if updatedAt != nil{
  167. aCoder.encode(updatedAt, forKey: "updated_at")
  168. }
  169. if zipcode != nil{
  170. aCoder.encode(zipcode, forKey: "zipcode")
  171. }
  172. }
  173. }
  174. class SelfAddresModel : NSObject, Mappable{
  175. var address : String?
  176. var addressType : Int?
  177. var areaId : Int?
  178. var areaName : String?
  179. var cityId : Int?
  180. var cityName : String?
  181. var contactMobile : String?
  182. var contactName : String?
  183. var createdAt : String?
  184. var deletedAt : AnyObject?
  185. var id : Int?
  186. var isDefault : Int?
  187. var pickupNodeId : Int?
  188. var provinceId : Int?
  189. var provinceName : String?
  190. var uid : Int?
  191. var updatedAt : String?
  192. var zipcode : Int?
  193. class func newInstance(map: Map) -> Mappable?{
  194. return SelfAddresModel()
  195. }
  196. required init?(map: Map){}
  197. private override init(){}
  198. func mapping(map: Map)
  199. {
  200. address <- map["address"]
  201. addressType <- map["address_type"]
  202. areaId <- map["area_id"]
  203. areaName <- map["area_name"]
  204. cityId <- map["city_id"]
  205. cityName <- map["city_name"]
  206. contactMobile <- map["contact_mobile"]
  207. contactName <- map["contact_name"]
  208. createdAt <- map["created_at"]
  209. deletedAt <- map["deleted_at"]
  210. id <- map["id"]
  211. isDefault <- map["is_default"]
  212. pickupNodeId <- map["pickup_node_id"]
  213. provinceId <- map["province_id"]
  214. provinceName <- map["province_name"]
  215. uid <- map["uid"]
  216. updatedAt <- map["updated_at"]
  217. zipcode <- map["zipcode"]
  218. }
  219. }