ApInvoiceBillLinkOrderRequest.py 2.2 KB

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