TradeAssocBillDetails.py 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class TradeAssocBillDetails(object):
  6. def __init__(self):
  7. self._acct_period = None
  8. self._bill_entry_amount = None
  9. self._bill_entry_id = None
  10. self._cost_type = None
  11. @property
  12. def acct_period(self):
  13. return self._acct_period
  14. @acct_period.setter
  15. def acct_period(self, value):
  16. self._acct_period = value
  17. @property
  18. def bill_entry_amount(self):
  19. return self._bill_entry_amount
  20. @bill_entry_amount.setter
  21. def bill_entry_amount(self, value):
  22. self._bill_entry_amount = value
  23. @property
  24. def bill_entry_id(self):
  25. return self._bill_entry_id
  26. @bill_entry_id.setter
  27. def bill_entry_id(self, value):
  28. self._bill_entry_id = value
  29. @property
  30. def cost_type(self):
  31. return self._cost_type
  32. @cost_type.setter
  33. def cost_type(self, value):
  34. self._cost_type = value
  35. def to_alipay_dict(self):
  36. params = dict()
  37. if self.acct_period:
  38. if hasattr(self.acct_period, 'to_alipay_dict'):
  39. params['acct_period'] = self.acct_period.to_alipay_dict()
  40. else:
  41. params['acct_period'] = self.acct_period
  42. if self.bill_entry_amount:
  43. if hasattr(self.bill_entry_amount, 'to_alipay_dict'):
  44. params['bill_entry_amount'] = self.bill_entry_amount.to_alipay_dict()
  45. else:
  46. params['bill_entry_amount'] = self.bill_entry_amount
  47. if self.bill_entry_id:
  48. if hasattr(self.bill_entry_id, 'to_alipay_dict'):
  49. params['bill_entry_id'] = self.bill_entry_id.to_alipay_dict()
  50. else:
  51. params['bill_entry_id'] = self.bill_entry_id
  52. if self.cost_type:
  53. if hasattr(self.cost_type, 'to_alipay_dict'):
  54. params['cost_type'] = self.cost_type.to_alipay_dict()
  55. else:
  56. params['cost_type'] = self.cost_type
  57. return params
  58. @staticmethod
  59. def from_alipay_dict(d):
  60. if not d:
  61. return None
  62. o = TradeAssocBillDetails()
  63. if 'acct_period' in d:
  64. o.acct_period = d['acct_period']
  65. if 'bill_entry_amount' in d:
  66. o.bill_entry_amount = d['bill_entry_amount']
  67. if 'bill_entry_id' in d:
  68. o.bill_entry_id = d['bill_entry_id']
  69. if 'cost_type' in d:
  70. o.cost_type = d['cost_type']
  71. return o