KoubeiRetailWmsBatchinventoryQueryModel.py 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class KoubeiRetailWmsBatchinventoryQueryModel(object):
  6. def __init__(self):
  7. self._goods_code_list = None
  8. self._inventory_type = None
  9. self._warehouse_code = None
  10. @property
  11. def goods_code_list(self):
  12. return self._goods_code_list
  13. @goods_code_list.setter
  14. def goods_code_list(self, value):
  15. if isinstance(value, list):
  16. self._goods_code_list = list()
  17. for i in value:
  18. self._goods_code_list.append(i)
  19. @property
  20. def inventory_type(self):
  21. return self._inventory_type
  22. @inventory_type.setter
  23. def inventory_type(self, value):
  24. self._inventory_type = value
  25. @property
  26. def warehouse_code(self):
  27. return self._warehouse_code
  28. @warehouse_code.setter
  29. def warehouse_code(self, value):
  30. self._warehouse_code = value
  31. def to_alipay_dict(self):
  32. params = dict()
  33. if self.goods_code_list:
  34. if isinstance(self.goods_code_list, list):
  35. for i in range(0, len(self.goods_code_list)):
  36. element = self.goods_code_list[i]
  37. if hasattr(element, 'to_alipay_dict'):
  38. self.goods_code_list[i] = element.to_alipay_dict()
  39. if hasattr(self.goods_code_list, 'to_alipay_dict'):
  40. params['goods_code_list'] = self.goods_code_list.to_alipay_dict()
  41. else:
  42. params['goods_code_list'] = self.goods_code_list
  43. if self.inventory_type:
  44. if hasattr(self.inventory_type, 'to_alipay_dict'):
  45. params['inventory_type'] = self.inventory_type.to_alipay_dict()
  46. else:
  47. params['inventory_type'] = self.inventory_type
  48. if self.warehouse_code:
  49. if hasattr(self.warehouse_code, 'to_alipay_dict'):
  50. params['warehouse_code'] = self.warehouse_code.to_alipay_dict()
  51. else:
  52. params['warehouse_code'] = self.warehouse_code
  53. return params
  54. @staticmethod
  55. def from_alipay_dict(d):
  56. if not d:
  57. return None
  58. o = KoubeiRetailWmsBatchinventoryQueryModel()
  59. if 'goods_code_list' in d:
  60. o.goods_code_list = d['goods_code_list']
  61. if 'inventory_type' in d:
  62. o.inventory_type = d['inventory_type']
  63. if 'warehouse_code' in d:
  64. o.warehouse_code = d['warehouse_code']
  65. return o