SpAccountInfo.py 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class SpAccountInfo(object):
  6. def __init__(self):
  7. self._account_inst_name = None
  8. self._account_name = None
  9. self._inst_branch_name = None
  10. self._inst_location = None
  11. self._sp_account_no = None
  12. @property
  13. def account_inst_name(self):
  14. return self._account_inst_name
  15. @account_inst_name.setter
  16. def account_inst_name(self, value):
  17. self._account_inst_name = value
  18. @property
  19. def account_name(self):
  20. return self._account_name
  21. @account_name.setter
  22. def account_name(self, value):
  23. self._account_name = value
  24. @property
  25. def inst_branch_name(self):
  26. return self._inst_branch_name
  27. @inst_branch_name.setter
  28. def inst_branch_name(self, value):
  29. self._inst_branch_name = value
  30. @property
  31. def inst_location(self):
  32. return self._inst_location
  33. @inst_location.setter
  34. def inst_location(self, value):
  35. self._inst_location = value
  36. @property
  37. def sp_account_no(self):
  38. return self._sp_account_no
  39. @sp_account_no.setter
  40. def sp_account_no(self, value):
  41. self._sp_account_no = value
  42. def to_alipay_dict(self):
  43. params = dict()
  44. if self.account_inst_name:
  45. if hasattr(self.account_inst_name, 'to_alipay_dict'):
  46. params['account_inst_name'] = self.account_inst_name.to_alipay_dict()
  47. else:
  48. params['account_inst_name'] = self.account_inst_name
  49. if self.account_name:
  50. if hasattr(self.account_name, 'to_alipay_dict'):
  51. params['account_name'] = self.account_name.to_alipay_dict()
  52. else:
  53. params['account_name'] = self.account_name
  54. if self.inst_branch_name:
  55. if hasattr(self.inst_branch_name, 'to_alipay_dict'):
  56. params['inst_branch_name'] = self.inst_branch_name.to_alipay_dict()
  57. else:
  58. params['inst_branch_name'] = self.inst_branch_name
  59. if self.inst_location:
  60. if hasattr(self.inst_location, 'to_alipay_dict'):
  61. params['inst_location'] = self.inst_location.to_alipay_dict()
  62. else:
  63. params['inst_location'] = self.inst_location
  64. if self.sp_account_no:
  65. if hasattr(self.sp_account_no, 'to_alipay_dict'):
  66. params['sp_account_no'] = self.sp_account_no.to_alipay_dict()
  67. else:
  68. params['sp_account_no'] = self.sp_account_no
  69. return params
  70. @staticmethod
  71. def from_alipay_dict(d):
  72. if not d:
  73. return None
  74. o = SpAccountInfo()
  75. if 'account_inst_name' in d:
  76. o.account_inst_name = d['account_inst_name']
  77. if 'account_name' in d:
  78. o.account_name = d['account_name']
  79. if 'inst_branch_name' in d:
  80. o.inst_branch_name = d['inst_branch_name']
  81. if 'inst_location' in d:
  82. o.inst_location = d['inst_location']
  83. if 'sp_account_no' in d:
  84. o.sp_account_no = d['sp_account_no']
  85. return o