MerchantBaseEnterOpenModel.py 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class MerchantBaseEnterOpenModel(object):
  6. def __init__(self):
  7. self._logo_info = None
  8. self._m_name = None
  9. self._m_short_name = None
  10. @property
  11. def logo_info(self):
  12. return self._logo_info
  13. @logo_info.setter
  14. def logo_info(self, value):
  15. self._logo_info = value
  16. @property
  17. def m_name(self):
  18. return self._m_name
  19. @m_name.setter
  20. def m_name(self, value):
  21. self._m_name = value
  22. @property
  23. def m_short_name(self):
  24. return self._m_short_name
  25. @m_short_name.setter
  26. def m_short_name(self, value):
  27. self._m_short_name = value
  28. def to_alipay_dict(self):
  29. params = dict()
  30. if self.logo_info:
  31. if hasattr(self.logo_info, 'to_alipay_dict'):
  32. params['logo_info'] = self.logo_info.to_alipay_dict()
  33. else:
  34. params['logo_info'] = self.logo_info
  35. if self.m_name:
  36. if hasattr(self.m_name, 'to_alipay_dict'):
  37. params['m_name'] = self.m_name.to_alipay_dict()
  38. else:
  39. params['m_name'] = self.m_name
  40. if self.m_short_name:
  41. if hasattr(self.m_short_name, 'to_alipay_dict'):
  42. params['m_short_name'] = self.m_short_name.to_alipay_dict()
  43. else:
  44. params['m_short_name'] = self.m_short_name
  45. return params
  46. @staticmethod
  47. def from_alipay_dict(d):
  48. if not d:
  49. return None
  50. o = MerchantBaseEnterOpenModel()
  51. if 'logo_info' in d:
  52. o.logo_info = d['logo_info']
  53. if 'm_name' in d:
  54. o.m_name = d['m_name']
  55. if 'm_short_name' in d:
  56. o.m_short_name = d['m_short_name']
  57. return o