KoubeiRetailWmsInventoryBatchqueryModel.py 3.2 KB

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