CMSApplication.swift 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. //
  2. // CMSApplication.swift
  3. // Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport
  4. import Foundation
  5. import ObjectMapper
  6. class CMSApplication : NSObject, NSCoding, Mappable{
  7. var count : Int?
  8. var data : [CMSData]?
  9. var date : String?
  10. var message : String?
  11. var position : Int?
  12. var size : Int?
  13. var spent : Int?
  14. var type : String?
  15. var userMessage : String?
  16. class func newInstance(map: Map) -> Mappable?{
  17. return CMSApplication()
  18. }
  19. required init?(map: Map){}
  20. private override init(){}
  21. func mapping(map: Map)
  22. {
  23. count <- map["count"]
  24. data <- map["data"]
  25. date <- map["date"]
  26. message <- map["message"]
  27. position <- map["position"]
  28. size <- map["size"]
  29. spent <- map["spent"]
  30. type <- map["type"]
  31. userMessage <- map["userMessage"]
  32. }
  33. /**
  34. * NSCoding required initializer.
  35. * Fills the data from the passed decoder
  36. */
  37. @objc required init(coder aDecoder: NSCoder)
  38. {
  39. count = aDecoder.decodeObject(forKey: "count") as? Int
  40. data = aDecoder.decodeObject(forKey: "data") as? [CMSData]
  41. date = aDecoder.decodeObject(forKey: "date") as? String
  42. message = aDecoder.decodeObject(forKey: "message") as? String
  43. position = aDecoder.decodeObject(forKey: "position") as? Int
  44. size = aDecoder.decodeObject(forKey: "size") as? Int
  45. spent = aDecoder.decodeObject(forKey: "spent") as? Int
  46. type = aDecoder.decodeObject(forKey: "type") as? String
  47. userMessage = aDecoder.decodeObject(forKey: "userMessage") as? String
  48. }
  49. /**
  50. * NSCoding required method.
  51. * Encodes mode properties into the decoder
  52. */
  53. @objc func encode(with aCoder: NSCoder)
  54. {
  55. if count != nil{
  56. aCoder.encode(count, forKey: "count")
  57. }
  58. if data != nil{
  59. aCoder.encode(data, forKey: "data")
  60. }
  61. if date != nil{
  62. aCoder.encode(date, forKey: "date")
  63. }
  64. if message != nil{
  65. aCoder.encode(message, forKey: "message")
  66. }
  67. if position != nil{
  68. aCoder.encode(position, forKey: "position")
  69. }
  70. if size != nil{
  71. aCoder.encode(size, forKey: "size")
  72. }
  73. if spent != nil{
  74. aCoder.encode(spent, forKey: "spent")
  75. }
  76. if type != nil{
  77. aCoder.encode(type, forKey: "type")
  78. }
  79. if userMessage != nil{
  80. aCoder.encode(userMessage, forKey: "userMessage")
  81. }
  82. }
  83. }