AlipayEcoLogisticsExpressPriceModifyModel.py 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AlipayEcoLogisticsExpressPriceModifyModel(object):
  6. def __init__(self):
  7. self._area_type = None
  8. self._extra_weight_price = None
  9. self._extra_weight_unit = None
  10. self._from_code = None
  11. self._logis_merch_code = None
  12. self._preset_weight = None
  13. self._preset_weight_price = None
  14. self._product_type_code = None
  15. self._to_code = None
  16. @property
  17. def area_type(self):
  18. return self._area_type
  19. @area_type.setter
  20. def area_type(self, value):
  21. self._area_type = value
  22. @property
  23. def extra_weight_price(self):
  24. return self._extra_weight_price
  25. @extra_weight_price.setter
  26. def extra_weight_price(self, value):
  27. self._extra_weight_price = value
  28. @property
  29. def extra_weight_unit(self):
  30. return self._extra_weight_unit
  31. @extra_weight_unit.setter
  32. def extra_weight_unit(self, value):
  33. self._extra_weight_unit = value
  34. @property
  35. def from_code(self):
  36. return self._from_code
  37. @from_code.setter
  38. def from_code(self, value):
  39. self._from_code = value
  40. @property
  41. def logis_merch_code(self):
  42. return self._logis_merch_code
  43. @logis_merch_code.setter
  44. def logis_merch_code(self, value):
  45. self._logis_merch_code = value
  46. @property
  47. def preset_weight(self):
  48. return self._preset_weight
  49. @preset_weight.setter
  50. def preset_weight(self, value):
  51. self._preset_weight = value
  52. @property
  53. def preset_weight_price(self):
  54. return self._preset_weight_price
  55. @preset_weight_price.setter
  56. def preset_weight_price(self, value):
  57. self._preset_weight_price = value
  58. @property
  59. def product_type_code(self):
  60. return self._product_type_code
  61. @product_type_code.setter
  62. def product_type_code(self, value):
  63. self._product_type_code = value
  64. @property
  65. def to_code(self):
  66. return self._to_code
  67. @to_code.setter
  68. def to_code(self, value):
  69. self._to_code = value
  70. def to_alipay_dict(self):
  71. params = dict()
  72. if self.area_type:
  73. if hasattr(self.area_type, 'to_alipay_dict'):
  74. params['area_type'] = self.area_type.to_alipay_dict()
  75. else:
  76. params['area_type'] = self.area_type
  77. if self.extra_weight_price:
  78. if hasattr(self.extra_weight_price, 'to_alipay_dict'):
  79. params['extra_weight_price'] = self.extra_weight_price.to_alipay_dict()
  80. else:
  81. params['extra_weight_price'] = self.extra_weight_price
  82. if self.extra_weight_unit:
  83. if hasattr(self.extra_weight_unit, 'to_alipay_dict'):
  84. params['extra_weight_unit'] = self.extra_weight_unit.to_alipay_dict()
  85. else:
  86. params['extra_weight_unit'] = self.extra_weight_unit
  87. if self.from_code:
  88. if hasattr(self.from_code, 'to_alipay_dict'):
  89. params['from_code'] = self.from_code.to_alipay_dict()
  90. else:
  91. params['from_code'] = self.from_code
  92. if self.logis_merch_code:
  93. if hasattr(self.logis_merch_code, 'to_alipay_dict'):
  94. params['logis_merch_code'] = self.logis_merch_code.to_alipay_dict()
  95. else:
  96. params['logis_merch_code'] = self.logis_merch_code
  97. if self.preset_weight:
  98. if hasattr(self.preset_weight, 'to_alipay_dict'):
  99. params['preset_weight'] = self.preset_weight.to_alipay_dict()
  100. else:
  101. params['preset_weight'] = self.preset_weight
  102. if self.preset_weight_price:
  103. if hasattr(self.preset_weight_price, 'to_alipay_dict'):
  104. params['preset_weight_price'] = self.preset_weight_price.to_alipay_dict()
  105. else:
  106. params['preset_weight_price'] = self.preset_weight_price
  107. if self.product_type_code:
  108. if hasattr(self.product_type_code, 'to_alipay_dict'):
  109. params['product_type_code'] = self.product_type_code.to_alipay_dict()
  110. else:
  111. params['product_type_code'] = self.product_type_code
  112. if self.to_code:
  113. if hasattr(self.to_code, 'to_alipay_dict'):
  114. params['to_code'] = self.to_code.to_alipay_dict()
  115. else:
  116. params['to_code'] = self.to_code
  117. return params
  118. @staticmethod
  119. def from_alipay_dict(d):
  120. if not d:
  121. return None
  122. o = AlipayEcoLogisticsExpressPriceModifyModel()
  123. if 'area_type' in d:
  124. o.area_type = d['area_type']
  125. if 'extra_weight_price' in d:
  126. o.extra_weight_price = d['extra_weight_price']
  127. if 'extra_weight_unit' in d:
  128. o.extra_weight_unit = d['extra_weight_unit']
  129. if 'from_code' in d:
  130. o.from_code = d['from_code']
  131. if 'logis_merch_code' in d:
  132. o.logis_merch_code = d['logis_merch_code']
  133. if 'preset_weight' in d:
  134. o.preset_weight = d['preset_weight']
  135. if 'preset_weight_price' in d:
  136. o.preset_weight_price = d['preset_weight_price']
  137. if 'product_type_code' in d:
  138. o.product_type_code = d['product_type_code']
  139. if 'to_code' in d:
  140. o.to_code = d['to_code']
  141. return o