LoginRetData.swift 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. //
  2. // Data.swift
  3. // Model file Generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport
  4. import Foundation
  5. struct LoginRetData{
  6. var addrBookSize : Int!
  7. var allowPush : Int!
  8. var appState : Int!
  9. var branch : String!
  10. var branchID : Int!
  11. var cid : String!
  12. var company : String!
  13. var device : LoginRetDevice!
  14. var devices : [LoginRetDevice]!
  15. var displayName : String!
  16. var duty : String!
  17. var email : String!
  18. var enableAccont : Bool!
  19. var enableMultiSendSms : Bool!
  20. var enableSendSms : Bool!
  21. var headImageUrl : String!
  22. var id : Int!
  23. var isFirst : Bool!
  24. var isLocked : Bool!
  25. var loginName : String!
  26. var loginState : Int!
  27. var mainRole : Int!
  28. var mobile : String!
  29. var needSMS : Bool!
  30. var password : String!
  31. var position : Int!
  32. var roles : String!
  33. var secret : Int!
  34. var serverID : String!
  35. var sex : Int!
  36. var shortMobile : AnyObject!
  37. var tel : AnyObject!
  38. var timestamp : Int!
  39. var trueName : String!
  40. var userType : Int!
  41. var version : Int!
  42. var watchword : String!
  43. /**
  44. * Instantiate the instance using the passed dictionary values to set the properties values
  45. */
  46. init(fromDictionary dictionary: NSDictionary){
  47. addrBookSize = dictionary["addrBookSize"] as? Int
  48. allowPush = dictionary["allowPush"] as? Int
  49. appState = dictionary["appState"] as? Int
  50. branch = dictionary["branch"] as? String
  51. branchID = dictionary["branchID"] as? Int
  52. cid = dictionary["cid"] as? String
  53. company = dictionary["company"] as? String
  54. if let deviceData = dictionary["device"] as? NSDictionary{
  55. device = LoginRetDevice(fromDictionary: deviceData)
  56. }
  57. devices = [LoginRetDevice]()
  58. if let devicesArray = dictionary["devices"] as? [NSDictionary]{
  59. for dic in devicesArray{
  60. let value = LoginRetDevice(fromDictionary: dic)
  61. devices.append(value)
  62. }
  63. }
  64. displayName = dictionary["displayName"] as? String
  65. duty = dictionary["duty"] as? String
  66. email = dictionary["email"] as? String
  67. enableAccont = dictionary["enableAccont"] as? Bool
  68. enableMultiSendSms = dictionary["enableMultiSendSms"] as? Bool
  69. enableSendSms = dictionary["enableSendSms"] as? Bool
  70. headImageUrl = dictionary["headImageUrl"] as? String
  71. id = dictionary["id"] as? Int
  72. isFirst = dictionary["isFirst"] as? Bool
  73. isLocked = dictionary["isLocked"] as? Bool
  74. loginName = dictionary["loginName"] as? String
  75. loginState = dictionary["loginState"] as? Int
  76. mainRole = dictionary["mainRole"] as? Int
  77. mobile = dictionary["mobile"] as? String
  78. needSMS = dictionary["needSMS"] as? Bool
  79. password = dictionary["password"] as? String
  80. position = dictionary["position"] as? Int
  81. roles = dictionary["roles"] as? String
  82. secret = dictionary["secret"] as? Int
  83. serverID = dictionary["serverID"] as? String
  84. sex = dictionary["sex"] as? Int
  85. shortMobile = dictionary["shortMobile"] as? String
  86. tel = dictionary["tel"] as? String
  87. timestamp = dictionary["timestamp"] as? Int
  88. trueName = dictionary["trueName"] as? String
  89. userType = dictionary["userType"] as? Int
  90. version = dictionary["version"] as? Int
  91. watchword = dictionary["watchword"] as? String
  92. }
  93. /**
  94. * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
  95. */
  96. func toDictionary() -> NSDictionary
  97. {
  98. var dictionary = NSMutableDictionary()
  99. if addrBookSize != nil{
  100. dictionary["addrBookSize"] = addrBookSize
  101. }
  102. if allowPush != nil{
  103. dictionary["allowPush"] = allowPush
  104. }
  105. if appState != nil{
  106. dictionary["appState"] = appState
  107. }
  108. if branch != nil{
  109. dictionary["branch"] = branch
  110. }
  111. if branchID != nil{
  112. dictionary["branchID"] = branchID
  113. }
  114. if cid != nil{
  115. dictionary["cid"] = cid
  116. }
  117. if company != nil{
  118. dictionary["company"] = company
  119. }
  120. if device != nil{
  121. dictionary["device"] = device.toDictionary()
  122. }
  123. if devices != nil{
  124. var dictionaryElements = [NSDictionary]()
  125. for devicesElement in devices {
  126. dictionaryElements.append(devicesElement.toDictionary())
  127. }
  128. dictionary["devices"] = dictionaryElements
  129. }
  130. if displayName != nil{
  131. dictionary["displayName"] = displayName
  132. }
  133. if duty != nil{
  134. dictionary["duty"] = duty
  135. }
  136. if email != nil{
  137. dictionary["email"] = email
  138. }
  139. if enableAccont != nil{
  140. dictionary["enableAccont"] = enableAccont
  141. }
  142. if enableMultiSendSms != nil{
  143. dictionary["enableMultiSendSms"] = enableMultiSendSms
  144. }
  145. if enableSendSms != nil{
  146. dictionary["enableSendSms"] = enableSendSms
  147. }
  148. if headImageUrl != nil{
  149. dictionary["headImageUrl"] = headImageUrl
  150. }
  151. if id != nil{
  152. dictionary["id"] = id
  153. }
  154. if isFirst != nil{
  155. dictionary["isFirst"] = isFirst
  156. }
  157. if isLocked != nil{
  158. dictionary["isLocked"] = isLocked
  159. }
  160. if loginName != nil{
  161. dictionary["loginName"] = loginName
  162. }
  163. if loginState != nil{
  164. dictionary["loginState"] = loginState
  165. }
  166. if mainRole != nil{
  167. dictionary["mainRole"] = mainRole
  168. }
  169. if mobile != nil{
  170. dictionary["mobile"] = mobile
  171. }
  172. if needSMS != nil{
  173. dictionary["needSMS"] = needSMS
  174. }
  175. if password != nil{
  176. dictionary["password"] = password
  177. }
  178. if position != nil{
  179. dictionary["position"] = position
  180. }
  181. if roles != nil{
  182. dictionary["roles"] = roles
  183. }
  184. if secret != nil{
  185. dictionary["secret"] = secret
  186. }
  187. if serverID != nil{
  188. dictionary["serverID"] = serverID
  189. }
  190. if sex != nil{
  191. dictionary["sex"] = sex
  192. }
  193. if shortMobile != nil{
  194. dictionary["shortMobile"] = shortMobile
  195. }
  196. if tel != nil{
  197. dictionary["tel"] = tel
  198. }
  199. if timestamp != nil{
  200. dictionary["timestamp"] = timestamp
  201. }
  202. if trueName != nil{
  203. dictionary["trueName"] = trueName
  204. }
  205. if userType != nil{
  206. dictionary["userType"] = userType
  207. }
  208. if version != nil{
  209. dictionary["version"] = version
  210. }
  211. if watchword != nil{
  212. dictionary["watchword"] = watchword
  213. }
  214. return dictionary
  215. }
  216. }