You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

135 lines
2.7 KiB

6 years ago
  1. //
  2. // MobileOperator.swift
  3. // GMERemittance
  4. //
  5. // Created by Fm-user on 3/8/18.
  6. // Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import Foundation
  9. class AvailableAmounts: Decodable{
  10. var converted: String
  11. var original: String
  12. init(converted: String, original: String) {
  13. self.converted = converted
  14. self.original = original
  15. }
  16. }
  17. class AvailableRechargeAmounts: Decodable{
  18. var serviceType:String?
  19. var availableAmounts: [AvailableAmounts]?
  20. init(serviceType: String, availableAmounts: [AvailableAmounts]) {
  21. self.serviceType = serviceType
  22. self.availableAmounts = availableAmounts
  23. }
  24. }
  25. class MobileOperator : Decodable{
  26. var telecomId: String?
  27. var country: String?
  28. var operatorName: String?
  29. var abbreviation: String?
  30. var iconUrl: String?
  31. var ServiceTypes:[String]?
  32. var availableAmounts: [AvailableAmounts]?
  33. init(telecomId:String,country:String,operatorName:String,abbreviation:String,iconUrl:String) {
  34. self.telecomId = telecomId
  35. self.country = country
  36. self.operatorName = operatorName
  37. self.abbreviation = abbreviation
  38. self.iconUrl = iconUrl
  39. }
  40. func getTelecomId() -> String{
  41. if let tId = telecomId{
  42. return tId
  43. }else{
  44. return "null"
  45. }
  46. }
  47. func getCountry() -> String {
  48. if let country = country{
  49. return country
  50. }else{
  51. return "null"
  52. }
  53. }
  54. func getOperatorName() -> String{
  55. if let oName = operatorName{
  56. return oName
  57. }else{
  58. return "null"
  59. }
  60. }
  61. func getAbbreviation() -> String {
  62. if let abbreviation = abbreviation{
  63. return abbreviation
  64. }else{
  65. return "null"
  66. }
  67. }
  68. func getIconUrl() -> String{
  69. if let icon = iconUrl{
  70. return icon
  71. }else{
  72. return "null"
  73. }
  74. }
  75. }
  76. //"telecomId": "1",
  77. //"country": "NEPAL",
  78. //"operatorName": "Nepal Telecom Corporation",
  79. //"abbreviation": "NTC",
  80. //"iconUrl": "http://116.66.197.118:1235/handler/docs.ashx?img=aHR0cDovL2ltYWdlcy9uc3QucG5n&module=dGVsSWNvbg==",
  81. //"denos": [
  82. //{
  83. //"serviceType": "Postpaid",
  84. //"availableTopupAmounts": [
  85. //"100.0000",
  86. //"150.0000",
  87. //"200.0000",
  88. //"300.0000",
  89. //"500.0000",
  90. //"1000.0000",
  91. //"2000.0000",
  92. //"3000.0000",
  93. //"4000.0000",
  94. //"5000.0000"
  95. //]
  96. //},
  97. //{
  98. //"serviceType": "Prepaid",
  99. //"availableTopupAmounts": [
  100. //"5000.0000",
  101. //"300.0000",
  102. //"500.0000",
  103. //"1000.0000",
  104. //"2000.0000",
  105. //"3000.0000",
  106. //"4000.0000",
  107. //"30.0000",
  108. //"40.0000",
  109. //"50.0000",
  110. //"100.0000",
  111. //"150.0000",
  112. //"200.0000",
  113. //"10.0000",
  114. //"20.0000"
  115. //]
  116. //}
  117. //]
  118. //},