EbppBillKey.py 2.8 KB

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