ZhimaMerchantOrderRentModifyModel.py 2.4 KB

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