KoubeiCateringDishDictionarySyncModel.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.KbdishDictionary import KbdishDictionary
  6. class KoubeiCateringDishDictionarySyncModel(object):
  7. def __init__(self):
  8. self._biz_type = None
  9. self._kb_dish_dictionary = 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 kb_dish_dictionary(self):
  19. return self._kb_dish_dictionary
  20. @kb_dish_dictionary.setter
  21. def kb_dish_dictionary(self, value):
  22. if isinstance(value, KbdishDictionary):
  23. self._kb_dish_dictionary = value
  24. else:
  25. self._kb_dish_dictionary = KbdishDictionary.from_alipay_dict(value)
  26. @property
  27. def syn_type(self):
  28. return self._syn_type
  29. @syn_type.setter
  30. def syn_type(self, value):
  31. self._syn_type = value
  32. def to_alipay_dict(self):
  33. params = dict()
  34. if self.biz_type:
  35. if hasattr(self.biz_type, 'to_alipay_dict'):
  36. params['biz_type'] = self.biz_type.to_alipay_dict()
  37. else:
  38. params['biz_type'] = self.biz_type
  39. if self.kb_dish_dictionary:
  40. if hasattr(self.kb_dish_dictionary, 'to_alipay_dict'):
  41. params['kb_dish_dictionary'] = self.kb_dish_dictionary.to_alipay_dict()
  42. else:
  43. params['kb_dish_dictionary'] = self.kb_dish_dictionary
  44. if self.syn_type:
  45. if hasattr(self.syn_type, 'to_alipay_dict'):
  46. params['syn_type'] = self.syn_type.to_alipay_dict()
  47. else:
  48. params['syn_type'] = self.syn_type
  49. return params
  50. @staticmethod
  51. def from_alipay_dict(d):
  52. if not d:
  53. return None
  54. o = KoubeiCateringDishDictionarySyncModel()
  55. if 'biz_type' in d:
  56. o.biz_type = d['biz_type']
  57. if 'kb_dish_dictionary' in d:
  58. o.kb_dish_dictionary = d['kb_dish_dictionary']
  59. if 'syn_type' in d:
  60. o.syn_type = d['syn_type']
  61. return o