ServerData.swift 1.8 KB

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