LoginRetDevice.swift 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. //
  2. // Device.swift
  3. // Model file Generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport
  4. import Foundation
  5. struct LoginRetDevice{
  6. var allowPush : Int!
  7. var id : String!
  8. var loginName : String!
  9. var serverID : String!
  10. var timestamp : Int!
  11. var token : String!
  12. var type : Int!
  13. var unreadCount : Int!
  14. var user : Int!
  15. /**
  16. * Instantiate the instance using the passed dictionary values to set the properties values
  17. */
  18. init(fromDictionary dictionary: NSDictionary){
  19. allowPush = dictionary["allowPush"] as? Int
  20. id = dictionary["id"] as? String
  21. loginName = dictionary["loginName"] as? String
  22. serverID = dictionary["serverID"] as? String
  23. timestamp = dictionary["timestamp"] as? Int
  24. token = dictionary["token"] as? String
  25. type = dictionary["type"] as? Int
  26. unreadCount = dictionary["unreadCount"] as? Int
  27. user = dictionary["user"] as? Int
  28. }
  29. /**
  30. * 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
  31. */
  32. func toDictionary() -> NSDictionary
  33. {
  34. var dictionary = NSMutableDictionary()
  35. if allowPush != nil{
  36. dictionary["allowPush"] = allowPush
  37. }
  38. if id != nil{
  39. dictionary["id"] = id
  40. }
  41. if loginName != nil{
  42. dictionary["loginName"] = loginName
  43. }
  44. if serverID != nil{
  45. dictionary["serverID"] = serverID
  46. }
  47. if timestamp != nil{
  48. dictionary["timestamp"] = timestamp
  49. }
  50. if token != nil{
  51. dictionary["token"] = token
  52. }
  53. if type != nil{
  54. dictionary["type"] = type
  55. }
  56. if unreadCount != nil{
  57. dictionary["unreadCount"] = unreadCount
  58. }
  59. if user != nil{
  60. dictionary["user"] = user
  61. }
  62. return dictionary
  63. }
  64. }