KoubeiCateringPosDishbatchDeleteModel.py 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class KoubeiCateringPosDishbatchDeleteModel(object):
  6. def __init__(self):
  7. self._cook_id = None
  8. self._dish_ids = None
  9. self._merchant_id = None
  10. self._shop_id = None
  11. @property
  12. def cook_id(self):
  13. return self._cook_id
  14. @cook_id.setter
  15. def cook_id(self, value):
  16. self._cook_id = value
  17. @property
  18. def dish_ids(self):
  19. return self._dish_ids
  20. @dish_ids.setter
  21. def dish_ids(self, value):
  22. if isinstance(value, list):
  23. self._dish_ids = list()
  24. for i in value:
  25. self._dish_ids.append(i)
  26. @property
  27. def merchant_id(self):
  28. return self._merchant_id
  29. @merchant_id.setter
  30. def merchant_id(self, value):
  31. self._merchant_id = value
  32. @property
  33. def shop_id(self):
  34. return self._shop_id
  35. @shop_id.setter
  36. def shop_id(self, value):
  37. self._shop_id = value
  38. def to_alipay_dict(self):
  39. params = dict()
  40. if self.cook_id:
  41. if hasattr(self.cook_id, 'to_alipay_dict'):
  42. params['cook_id'] = self.cook_id.to_alipay_dict()
  43. else:
  44. params['cook_id'] = self.cook_id
  45. if self.dish_ids:
  46. if isinstance(self.dish_ids, list):
  47. for i in range(0, len(self.dish_ids)):
  48. element = self.dish_ids[i]
  49. if hasattr(element, 'to_alipay_dict'):
  50. self.dish_ids[i] = element.to_alipay_dict()
  51. if hasattr(self.dish_ids, 'to_alipay_dict'):
  52. params['dish_ids'] = self.dish_ids.to_alipay_dict()
  53. else:
  54. params['dish_ids'] = self.dish_ids
  55. if self.merchant_id:
  56. if hasattr(self.merchant_id, 'to_alipay_dict'):
  57. params['merchant_id'] = self.merchant_id.to_alipay_dict()
  58. else:
  59. params['merchant_id'] = self.merchant_id
  60. if self.shop_id:
  61. if hasattr(self.shop_id, 'to_alipay_dict'):
  62. params['shop_id'] = self.shop_id.to_alipay_dict()
  63. else:
  64. params['shop_id'] = self.shop_id
  65. return params
  66. @staticmethod
  67. def from_alipay_dict(d):
  68. if not d:
  69. return None
  70. o = KoubeiCateringPosDishbatchDeleteModel()
  71. if 'cook_id' in d:
  72. o.cook_id = d['cook_id']
  73. if 'dish_ids' in d:
  74. o.dish_ids = d['dish_ids']
  75. if 'merchant_id' in d:
  76. o.merchant_id = d['merchant_id']
  77. if 'shop_id' in d:
  78. o.shop_id = d['shop_id']
  79. return o