CMSCategory.swift 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. //
  2. // CMSCategory.swift
  3. // Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport
  4. import Foundation
  5. import ObjectMapper
  6. class CMSCategory : NSObject, NSCoding, Mappable{
  7. var count : Int?
  8. var data : [CMSCategoryItemData]?
  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 CMSCategory()
  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? [CMSCategoryItemData]
  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. }