KbdishAreaFreeInfo.py 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class KbdishAreaFreeInfo(object):
  6. def __init__(self):
  7. self._area_id = None
  8. self._count = None
  9. self._dish_id = None
  10. self._dish_sku_id = None
  11. self._status = None
  12. @property
  13. def area_id(self):
  14. return self._area_id
  15. @area_id.setter
  16. def area_id(self, value):
  17. self._area_id = value
  18. @property
  19. def count(self):
  20. return self._count
  21. @count.setter
  22. def count(self, value):
  23. self._count = value
  24. @property
  25. def dish_id(self):
  26. return self._dish_id
  27. @dish_id.setter
  28. def dish_id(self, value):
  29. self._dish_id = value
  30. @property
  31. def dish_sku_id(self):
  32. return self._dish_sku_id
  33. @dish_sku_id.setter
  34. def dish_sku_id(self, value):
  35. self._dish_sku_id = value
  36. @property
  37. def status(self):
  38. return self._status
  39. @status.setter
  40. def status(self, value):
  41. self._status = value
  42. def to_alipay_dict(self):
  43. params = dict()
  44. if self.area_id:
  45. if hasattr(self.area_id, 'to_alipay_dict'):
  46. params['area_id'] = self.area_id.to_alipay_dict()
  47. else:
  48. params['area_id'] = self.area_id
  49. if self.count:
  50. if hasattr(self.count, 'to_alipay_dict'):
  51. params['count'] = self.count.to_alipay_dict()
  52. else:
  53. params['count'] = self.count
  54. if self.dish_id:
  55. if hasattr(self.dish_id, 'to_alipay_dict'):
  56. params['dish_id'] = self.dish_id.to_alipay_dict()
  57. else:
  58. params['dish_id'] = self.dish_id
  59. if self.dish_sku_id:
  60. if hasattr(self.dish_sku_id, 'to_alipay_dict'):
  61. params['dish_sku_id'] = self.dish_sku_id.to_alipay_dict()
  62. else:
  63. params['dish_sku_id'] = self.dish_sku_id
  64. if self.status:
  65. if hasattr(self.status, 'to_alipay_dict'):
  66. params['status'] = self.status.to_alipay_dict()
  67. else:
  68. params['status'] = self.status
  69. return params
  70. @staticmethod
  71. def from_alipay_dict(d):
  72. if not d:
  73. return None
  74. o = KbdishAreaFreeInfo()
  75. if 'area_id' in d:
  76. o.area_id = d['area_id']
  77. if 'count' in d:
  78. o.count = d['count']
  79. if 'dish_id' in d:
  80. o.dish_id = d['dish_id']
  81. if 'dish_sku_id' in d:
  82. o.dish_sku_id = d['dish_sku_id']
  83. if 'status' in d:
  84. o.status = d['status']
  85. return o