MaintainBizOrder.py 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class MaintainBizOrder(object):
  6. def __init__(self):
  7. self._origin_cost = None
  8. self._out_product_id = None
  9. self._real_cost = None
  10. self._sale_num = None
  11. self._service_category_id = None
  12. @property
  13. def origin_cost(self):
  14. return self._origin_cost
  15. @origin_cost.setter
  16. def origin_cost(self, value):
  17. self._origin_cost = value
  18. @property
  19. def out_product_id(self):
  20. return self._out_product_id
  21. @out_product_id.setter
  22. def out_product_id(self, value):
  23. self._out_product_id = value
  24. @property
  25. def real_cost(self):
  26. return self._real_cost
  27. @real_cost.setter
  28. def real_cost(self, value):
  29. self._real_cost = value
  30. @property
  31. def sale_num(self):
  32. return self._sale_num
  33. @sale_num.setter
  34. def sale_num(self, value):
  35. self._sale_num = value
  36. @property
  37. def service_category_id(self):
  38. return self._service_category_id
  39. @service_category_id.setter
  40. def service_category_id(self, value):
  41. self._service_category_id = value
  42. def to_alipay_dict(self):
  43. params = dict()
  44. if self.origin_cost:
  45. if hasattr(self.origin_cost, 'to_alipay_dict'):
  46. params['origin_cost'] = self.origin_cost.to_alipay_dict()
  47. else:
  48. params['origin_cost'] = self.origin_cost
  49. if self.out_product_id:
  50. if hasattr(self.out_product_id, 'to_alipay_dict'):
  51. params['out_product_id'] = self.out_product_id.to_alipay_dict()
  52. else:
  53. params['out_product_id'] = self.out_product_id
  54. if self.real_cost:
  55. if hasattr(self.real_cost, 'to_alipay_dict'):
  56. params['real_cost'] = self.real_cost.to_alipay_dict()
  57. else:
  58. params['real_cost'] = self.real_cost
  59. if self.sale_num:
  60. if hasattr(self.sale_num, 'to_alipay_dict'):
  61. params['sale_num'] = self.sale_num.to_alipay_dict()
  62. else:
  63. params['sale_num'] = self.sale_num
  64. if self.service_category_id:
  65. if hasattr(self.service_category_id, 'to_alipay_dict'):
  66. params['service_category_id'] = self.service_category_id.to_alipay_dict()
  67. else:
  68. params['service_category_id'] = self.service_category_id
  69. return params
  70. @staticmethod
  71. def from_alipay_dict(d):
  72. if not d:
  73. return None
  74. o = MaintainBizOrder()
  75. if 'origin_cost' in d:
  76. o.origin_cost = d['origin_cost']
  77. if 'out_product_id' in d:
  78. o.out_product_id = d['out_product_id']
  79. if 'real_cost' in d:
  80. o.real_cost = d['real_cost']
  81. if 'sale_num' in d:
  82. o.sale_num = d['sale_num']
  83. if 'service_category_id' in d:
  84. o.service_category_id = d['service_category_id']
  85. return o