ErrorDishStallEntity.py 2.7 KB

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