AlipayEcoRenthousePublicrentApplyscheduleSyncModel.py 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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.EcoApplySchedule import EcoApplySchedule
  6. class AlipayEcoRenthousePublicrentApplyscheduleSyncModel(object):
  7. def __init__(self):
  8. self._apply_schedule_list = None
  9. self._cert_no = None
  10. self._rent_id = None
  11. @property
  12. def apply_schedule_list(self):
  13. return self._apply_schedule_list
  14. @apply_schedule_list.setter
  15. def apply_schedule_list(self, value):
  16. if isinstance(value, list):
  17. self._apply_schedule_list = list()
  18. for i in value:
  19. if isinstance(i, EcoApplySchedule):
  20. self._apply_schedule_list.append(i)
  21. else:
  22. self._apply_schedule_list.append(EcoApplySchedule.from_alipay_dict(i))
  23. @property
  24. def cert_no(self):
  25. return self._cert_no
  26. @cert_no.setter
  27. def cert_no(self, value):
  28. self._cert_no = value
  29. @property
  30. def rent_id(self):
  31. return self._rent_id
  32. @rent_id.setter
  33. def rent_id(self, value):
  34. self._rent_id = value
  35. def to_alipay_dict(self):
  36. params = dict()
  37. if self.apply_schedule_list:
  38. if isinstance(self.apply_schedule_list, list):
  39. for i in range(0, len(self.apply_schedule_list)):
  40. element = self.apply_schedule_list[i]
  41. if hasattr(element, 'to_alipay_dict'):
  42. self.apply_schedule_list[i] = element.to_alipay_dict()
  43. if hasattr(self.apply_schedule_list, 'to_alipay_dict'):
  44. params['apply_schedule_list'] = self.apply_schedule_list.to_alipay_dict()
  45. else:
  46. params['apply_schedule_list'] = self.apply_schedule_list
  47. if self.cert_no:
  48. if hasattr(self.cert_no, 'to_alipay_dict'):
  49. params['cert_no'] = self.cert_no.to_alipay_dict()
  50. else:
  51. params['cert_no'] = self.cert_no
  52. if self.rent_id:
  53. if hasattr(self.rent_id, 'to_alipay_dict'):
  54. params['rent_id'] = self.rent_id.to_alipay_dict()
  55. else:
  56. params['rent_id'] = self.rent_id
  57. return params
  58. @staticmethod
  59. def from_alipay_dict(d):
  60. if not d:
  61. return None
  62. o = AlipayEcoRenthousePublicrentApplyscheduleSyncModel()
  63. if 'apply_schedule_list' in d:
  64. o.apply_schedule_list = d['apply_schedule_list']
  65. if 'cert_no' in d:
  66. o.cert_no = d['cert_no']
  67. if 'rent_id' in d:
  68. o.rent_id = d['rent_id']
  69. return o