AlipayBossOrderApplyModel.py 1.9 KB

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