AssetInfoItem.py 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AssetInfoItem(object):
  6. def __init__(self):
  7. self._assign_item_id = None
  8. self._batch_no = None
  9. self._logistics_code = None
  10. self._logistics_no = None
  11. self._sub_type = None
  12. self._type = None
  13. self._value = None
  14. @property
  15. def assign_item_id(self):
  16. return self._assign_item_id
  17. @assign_item_id.setter
  18. def assign_item_id(self, value):
  19. self._assign_item_id = value
  20. @property
  21. def batch_no(self):
  22. return self._batch_no
  23. @batch_no.setter
  24. def batch_no(self, value):
  25. self._batch_no = value
  26. @property
  27. def logistics_code(self):
  28. return self._logistics_code
  29. @logistics_code.setter
  30. def logistics_code(self, value):
  31. self._logistics_code = value
  32. @property
  33. def logistics_no(self):
  34. return self._logistics_no
  35. @logistics_no.setter
  36. def logistics_no(self, value):
  37. self._logistics_no = value
  38. @property
  39. def sub_type(self):
  40. return self._sub_type
  41. @sub_type.setter
  42. def sub_type(self, value):
  43. self._sub_type = value
  44. @property
  45. def type(self):
  46. return self._type
  47. @type.setter
  48. def type(self, value):
  49. self._type = value
  50. @property
  51. def value(self):
  52. return self._value
  53. @value.setter
  54. def value(self, value):
  55. self._value = value
  56. def to_alipay_dict(self):
  57. params = dict()
  58. if self.assign_item_id:
  59. if hasattr(self.assign_item_id, 'to_alipay_dict'):
  60. params['assign_item_id'] = self.assign_item_id.to_alipay_dict()
  61. else:
  62. params['assign_item_id'] = self.assign_item_id
  63. if self.batch_no:
  64. if hasattr(self.batch_no, 'to_alipay_dict'):
  65. params['batch_no'] = self.batch_no.to_alipay_dict()
  66. else:
  67. params['batch_no'] = self.batch_no
  68. if self.logistics_code:
  69. if hasattr(self.logistics_code, 'to_alipay_dict'):
  70. params['logistics_code'] = self.logistics_code.to_alipay_dict()
  71. else:
  72. params['logistics_code'] = self.logistics_code
  73. if self.logistics_no:
  74. if hasattr(self.logistics_no, 'to_alipay_dict'):
  75. params['logistics_no'] = self.logistics_no.to_alipay_dict()
  76. else:
  77. params['logistics_no'] = self.logistics_no
  78. if self.sub_type:
  79. if hasattr(self.sub_type, 'to_alipay_dict'):
  80. params['sub_type'] = self.sub_type.to_alipay_dict()
  81. else:
  82. params['sub_type'] = self.sub_type
  83. if self.type:
  84. if hasattr(self.type, 'to_alipay_dict'):
  85. params['type'] = self.type.to_alipay_dict()
  86. else:
  87. params['type'] = self.type
  88. if self.value:
  89. if hasattr(self.value, 'to_alipay_dict'):
  90. params['value'] = self.value.to_alipay_dict()
  91. else:
  92. params['value'] = self.value
  93. return params
  94. @staticmethod
  95. def from_alipay_dict(d):
  96. if not d:
  97. return None
  98. o = AssetInfoItem()
  99. if 'assign_item_id' in d:
  100. o.assign_item_id = d['assign_item_id']
  101. if 'batch_no' in d:
  102. o.batch_no = d['batch_no']
  103. if 'logistics_code' in d:
  104. o.logistics_code = d['logistics_code']
  105. if 'logistics_no' in d:
  106. o.logistics_no = d['logistics_no']
  107. if 'sub_type' in d:
  108. o.sub_type = d['sub_type']
  109. if 'type' in d:
  110. o.type = d['type']
  111. if 'value' in d:
  112. o.value = d['value']
  113. return o