KoubeiCateringItemQueryModel.py 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class KoubeiCateringItemQueryModel(object):
  6. def __init__(self):
  7. self._auth_code = None
  8. self._item_id = None
  9. self._operator_type = None
  10. self._request_id = None
  11. @property
  12. def auth_code(self):
  13. return self._auth_code
  14. @auth_code.setter
  15. def auth_code(self, value):
  16. self._auth_code = value
  17. @property
  18. def item_id(self):
  19. return self._item_id
  20. @item_id.setter
  21. def item_id(self, value):
  22. self._item_id = value
  23. @property
  24. def operator_type(self):
  25. return self._operator_type
  26. @operator_type.setter
  27. def operator_type(self, value):
  28. self._operator_type = value
  29. @property
  30. def request_id(self):
  31. return self._request_id
  32. @request_id.setter
  33. def request_id(self, value):
  34. self._request_id = value
  35. def to_alipay_dict(self):
  36. params = dict()
  37. if self.auth_code:
  38. if hasattr(self.auth_code, 'to_alipay_dict'):
  39. params['auth_code'] = self.auth_code.to_alipay_dict()
  40. else:
  41. params['auth_code'] = self.auth_code
  42. if self.item_id:
  43. if hasattr(self.item_id, 'to_alipay_dict'):
  44. params['item_id'] = self.item_id.to_alipay_dict()
  45. else:
  46. params['item_id'] = self.item_id
  47. if self.operator_type:
  48. if hasattr(self.operator_type, 'to_alipay_dict'):
  49. params['operator_type'] = self.operator_type.to_alipay_dict()
  50. else:
  51. params['operator_type'] = self.operator_type
  52. if self.request_id:
  53. if hasattr(self.request_id, 'to_alipay_dict'):
  54. params['request_id'] = self.request_id.to_alipay_dict()
  55. else:
  56. params['request_id'] = self.request_id
  57. return params
  58. @staticmethod
  59. def from_alipay_dict(d):
  60. if not d:
  61. return None
  62. o = KoubeiCateringItemQueryModel()
  63. if 'auth_code' in d:
  64. o.auth_code = d['auth_code']
  65. if 'item_id' in d:
  66. o.item_id = d['item_id']
  67. if 'operator_type' in d:
  68. o.operator_type = d['operator_type']
  69. if 'request_id' in d:
  70. o.request_id = d['request_id']
  71. return o