ApplyGoodsInfo.py 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class ApplyGoodsInfo(object):
  6. def __init__(self):
  7. self._alipay_goods_id = None
  8. self._goods_name = None
  9. self._remark = None
  10. self._show_url_1 = None
  11. self._show_url_2 = None
  12. self._show_url_3 = None
  13. self._three_dimension = None
  14. self._weight = None
  15. @property
  16. def alipay_goods_id(self):
  17. return self._alipay_goods_id
  18. @alipay_goods_id.setter
  19. def alipay_goods_id(self, value):
  20. self._alipay_goods_id = value
  21. @property
  22. def goods_name(self):
  23. return self._goods_name
  24. @goods_name.setter
  25. def goods_name(self, value):
  26. self._goods_name = value
  27. @property
  28. def remark(self):
  29. return self._remark
  30. @remark.setter
  31. def remark(self, value):
  32. self._remark = value
  33. @property
  34. def show_url_1(self):
  35. return self._show_url_1
  36. @show_url_1.setter
  37. def show_url_1(self, value):
  38. self._show_url_1 = value
  39. @property
  40. def show_url_2(self):
  41. return self._show_url_2
  42. @show_url_2.setter
  43. def show_url_2(self, value):
  44. self._show_url_2 = value
  45. @property
  46. def show_url_3(self):
  47. return self._show_url_3
  48. @show_url_3.setter
  49. def show_url_3(self, value):
  50. self._show_url_3 = value
  51. @property
  52. def three_dimension(self):
  53. return self._three_dimension
  54. @three_dimension.setter
  55. def three_dimension(self, value):
  56. self._three_dimension = value
  57. @property
  58. def weight(self):
  59. return self._weight
  60. @weight.setter
  61. def weight(self, value):
  62. self._weight = value
  63. def to_alipay_dict(self):
  64. params = dict()
  65. if self.alipay_goods_id:
  66. if hasattr(self.alipay_goods_id, 'to_alipay_dict'):
  67. params['alipay_goods_id'] = self.alipay_goods_id.to_alipay_dict()
  68. else:
  69. params['alipay_goods_id'] = self.alipay_goods_id
  70. if self.goods_name:
  71. if hasattr(self.goods_name, 'to_alipay_dict'):
  72. params['goods_name'] = self.goods_name.to_alipay_dict()
  73. else:
  74. params['goods_name'] = self.goods_name
  75. if self.remark:
  76. if hasattr(self.remark, 'to_alipay_dict'):
  77. params['remark'] = self.remark.to_alipay_dict()
  78. else:
  79. params['remark'] = self.remark
  80. if self.show_url_1:
  81. if hasattr(self.show_url_1, 'to_alipay_dict'):
  82. params['show_url_1'] = self.show_url_1.to_alipay_dict()
  83. else:
  84. params['show_url_1'] = self.show_url_1
  85. if self.show_url_2:
  86. if hasattr(self.show_url_2, 'to_alipay_dict'):
  87. params['show_url_2'] = self.show_url_2.to_alipay_dict()
  88. else:
  89. params['show_url_2'] = self.show_url_2
  90. if self.show_url_3:
  91. if hasattr(self.show_url_3, 'to_alipay_dict'):
  92. params['show_url_3'] = self.show_url_3.to_alipay_dict()
  93. else:
  94. params['show_url_3'] = self.show_url_3
  95. if self.three_dimension:
  96. if hasattr(self.three_dimension, 'to_alipay_dict'):
  97. params['three_dimension'] = self.three_dimension.to_alipay_dict()
  98. else:
  99. params['three_dimension'] = self.three_dimension
  100. if self.weight:
  101. if hasattr(self.weight, 'to_alipay_dict'):
  102. params['weight'] = self.weight.to_alipay_dict()
  103. else:
  104. params['weight'] = self.weight
  105. return params
  106. @staticmethod
  107. def from_alipay_dict(d):
  108. if not d:
  109. return None
  110. o = ApplyGoodsInfo()
  111. if 'alipay_goods_id' in d:
  112. o.alipay_goods_id = d['alipay_goods_id']
  113. if 'goods_name' in d:
  114. o.goods_name = d['goods_name']
  115. if 'remark' in d:
  116. o.remark = d['remark']
  117. if 'show_url_1' in d:
  118. o.show_url_1 = d['show_url_1']
  119. if 'show_url_2' in d:
  120. o.show_url_2 = d['show_url_2']
  121. if 'show_url_3' in d:
  122. o.show_url_3 = d['show_url_3']
  123. if 'three_dimension' in d:
  124. o.three_dimension = d['three_dimension']
  125. if 'weight' in d:
  126. o.weight = d['weight']
  127. return o