KoubeiCateringPosDeskCreateModel.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 KoubeiCateringPosDeskCreateModel(object):
  6. def __init__(self):
  7. self._area_id = None
  8. self._desk_name = None
  9. self._max_num = None
  10. self._num = None
  11. self._shop_id = 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 desk_name(self):
  20. return self._desk_name
  21. @desk_name.setter
  22. def desk_name(self, value):
  23. self._desk_name = value
  24. @property
  25. def max_num(self):
  26. return self._max_num
  27. @max_num.setter
  28. def max_num(self, value):
  29. self._max_num = value
  30. @property
  31. def num(self):
  32. return self._num
  33. @num.setter
  34. def num(self, value):
  35. self._num = value
  36. @property
  37. def shop_id(self):
  38. return self._shop_id
  39. @shop_id.setter
  40. def shop_id(self, value):
  41. self._shop_id = 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.desk_name:
  50. if hasattr(self.desk_name, 'to_alipay_dict'):
  51. params['desk_name'] = self.desk_name.to_alipay_dict()
  52. else:
  53. params['desk_name'] = self.desk_name
  54. if self.max_num:
  55. if hasattr(self.max_num, 'to_alipay_dict'):
  56. params['max_num'] = self.max_num.to_alipay_dict()
  57. else:
  58. params['max_num'] = self.max_num
  59. if self.num:
  60. if hasattr(self.num, 'to_alipay_dict'):
  61. params['num'] = self.num.to_alipay_dict()
  62. else:
  63. params['num'] = self.num
  64. if self.shop_id:
  65. if hasattr(self.shop_id, 'to_alipay_dict'):
  66. params['shop_id'] = self.shop_id.to_alipay_dict()
  67. else:
  68. params['shop_id'] = self.shop_id
  69. return params
  70. @staticmethod
  71. def from_alipay_dict(d):
  72. if not d:
  73. return None
  74. o = KoubeiCateringPosDeskCreateModel()
  75. if 'area_id' in d:
  76. o.area_id = d['area_id']
  77. if 'desk_name' in d:
  78. o.desk_name = d['desk_name']
  79. if 'max_num' in d:
  80. o.max_num = d['max_num']
  81. if 'num' in d:
  82. o.num = d['num']
  83. if 'shop_id' in d:
  84. o.shop_id = d['shop_id']
  85. return o