TradePrecreateConfirmTradeMerchantInfo.py 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class TradePrecreateConfirmTradeMerchantInfo(object):
  6. def __init__(self):
  7. self._city_code = None
  8. self._city_name_sc = None
  9. self._id = None
  10. self._mcc = None
  11. self._merchant_type = None
  12. self._name = None
  13. @property
  14. def city_code(self):
  15. return self._city_code
  16. @city_code.setter
  17. def city_code(self, value):
  18. self._city_code = value
  19. @property
  20. def city_name_sc(self):
  21. return self._city_name_sc
  22. @city_name_sc.setter
  23. def city_name_sc(self, value):
  24. self._city_name_sc = value
  25. @property
  26. def id(self):
  27. return self._id
  28. @id.setter
  29. def id(self, value):
  30. self._id = value
  31. @property
  32. def mcc(self):
  33. return self._mcc
  34. @mcc.setter
  35. def mcc(self, value):
  36. self._mcc = value
  37. @property
  38. def merchant_type(self):
  39. return self._merchant_type
  40. @merchant_type.setter
  41. def merchant_type(self, value):
  42. self._merchant_type = value
  43. @property
  44. def name(self):
  45. return self._name
  46. @name.setter
  47. def name(self, value):
  48. self._name = value
  49. def to_alipay_dict(self):
  50. params = dict()
  51. if self.city_code:
  52. if hasattr(self.city_code, 'to_alipay_dict'):
  53. params['city_code'] = self.city_code.to_alipay_dict()
  54. else:
  55. params['city_code'] = self.city_code
  56. if self.city_name_sc:
  57. if hasattr(self.city_name_sc, 'to_alipay_dict'):
  58. params['city_name_sc'] = self.city_name_sc.to_alipay_dict()
  59. else:
  60. params['city_name_sc'] = self.city_name_sc
  61. if self.id:
  62. if hasattr(self.id, 'to_alipay_dict'):
  63. params['id'] = self.id.to_alipay_dict()
  64. else:
  65. params['id'] = self.id
  66. if self.mcc:
  67. if hasattr(self.mcc, 'to_alipay_dict'):
  68. params['mcc'] = self.mcc.to_alipay_dict()
  69. else:
  70. params['mcc'] = self.mcc
  71. if self.merchant_type:
  72. if hasattr(self.merchant_type, 'to_alipay_dict'):
  73. params['merchant_type'] = self.merchant_type.to_alipay_dict()
  74. else:
  75. params['merchant_type'] = self.merchant_type
  76. if self.name:
  77. if hasattr(self.name, 'to_alipay_dict'):
  78. params['name'] = self.name.to_alipay_dict()
  79. else:
  80. params['name'] = self.name
  81. return params
  82. @staticmethod
  83. def from_alipay_dict(d):
  84. if not d:
  85. return None
  86. o = TradePrecreateConfirmTradeMerchantInfo()
  87. if 'city_code' in d:
  88. o.city_code = d['city_code']
  89. if 'city_name_sc' in d:
  90. o.city_name_sc = d['city_name_sc']
  91. if 'id' in d:
  92. o.id = d['id']
  93. if 'mcc' in d:
  94. o.mcc = d['mcc']
  95. if 'merchant_type' in d:
  96. o.merchant_type = d['merchant_type']
  97. if 'name' in d:
  98. o.name = d['name']
  99. return o