AlipayEcoMycarMaintainServiceproductUpdateModel.py 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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.MaitainShopProduct import MaitainShopProduct
  6. class AlipayEcoMycarMaintainServiceproductUpdateModel(object):
  7. def __init__(self):
  8. self._operation_type = None
  9. self._out_product_id = None
  10. self._shop_product = None
  11. @property
  12. def operation_type(self):
  13. return self._operation_type
  14. @operation_type.setter
  15. def operation_type(self, value):
  16. self._operation_type = value
  17. @property
  18. def out_product_id(self):
  19. return self._out_product_id
  20. @out_product_id.setter
  21. def out_product_id(self, value):
  22. self._out_product_id = value
  23. @property
  24. def shop_product(self):
  25. return self._shop_product
  26. @shop_product.setter
  27. def shop_product(self, value):
  28. if isinstance(value, MaitainShopProduct):
  29. self._shop_product = value
  30. else:
  31. self._shop_product = MaitainShopProduct.from_alipay_dict(value)
  32. def to_alipay_dict(self):
  33. params = dict()
  34. if self.operation_type:
  35. if hasattr(self.operation_type, 'to_alipay_dict'):
  36. params['operation_type'] = self.operation_type.to_alipay_dict()
  37. else:
  38. params['operation_type'] = self.operation_type
  39. if self.out_product_id:
  40. if hasattr(self.out_product_id, 'to_alipay_dict'):
  41. params['out_product_id'] = self.out_product_id.to_alipay_dict()
  42. else:
  43. params['out_product_id'] = self.out_product_id
  44. if self.shop_product:
  45. if hasattr(self.shop_product, 'to_alipay_dict'):
  46. params['shop_product'] = self.shop_product.to_alipay_dict()
  47. else:
  48. params['shop_product'] = self.shop_product
  49. return params
  50. @staticmethod
  51. def from_alipay_dict(d):
  52. if not d:
  53. return None
  54. o = AlipayEcoMycarMaintainServiceproductUpdateModel()
  55. if 'operation_type' in d:
  56. o.operation_type = d['operation_type']
  57. if 'out_product_id' in d:
  58. o.out_product_id = d['out_product_id']
  59. if 'shop_product' in d:
  60. o.shop_product = d['shop_product']
  61. return o