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