AlgorithmGoodsInfo.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 AlgorithmGoodsInfo(object):
  6. def __init__(self):
  7. self._algorithm_goods_id = None
  8. self._gif_file_id = None
  9. self._pic_file_id = None
  10. self._three_dimension = None
  11. self._thumbnails = None
  12. @property
  13. def algorithm_goods_id(self):
  14. return self._algorithm_goods_id
  15. @algorithm_goods_id.setter
  16. def algorithm_goods_id(self, value):
  17. self._algorithm_goods_id = value
  18. @property
  19. def gif_file_id(self):
  20. return self._gif_file_id
  21. @gif_file_id.setter
  22. def gif_file_id(self, value):
  23. self._gif_file_id = value
  24. @property
  25. def pic_file_id(self):
  26. return self._pic_file_id
  27. @pic_file_id.setter
  28. def pic_file_id(self, value):
  29. self._pic_file_id = value
  30. @property
  31. def three_dimension(self):
  32. return self._three_dimension
  33. @three_dimension.setter
  34. def three_dimension(self, value):
  35. self._three_dimension = value
  36. @property
  37. def thumbnails(self):
  38. return self._thumbnails
  39. @thumbnails.setter
  40. def thumbnails(self, value):
  41. self._thumbnails = value
  42. def to_alipay_dict(self):
  43. params = dict()
  44. if self.algorithm_goods_id:
  45. if hasattr(self.algorithm_goods_id, 'to_alipay_dict'):
  46. params['algorithm_goods_id'] = self.algorithm_goods_id.to_alipay_dict()
  47. else:
  48. params['algorithm_goods_id'] = self.algorithm_goods_id
  49. if self.gif_file_id:
  50. if hasattr(self.gif_file_id, 'to_alipay_dict'):
  51. params['gif_file_id'] = self.gif_file_id.to_alipay_dict()
  52. else:
  53. params['gif_file_id'] = self.gif_file_id
  54. if self.pic_file_id:
  55. if hasattr(self.pic_file_id, 'to_alipay_dict'):
  56. params['pic_file_id'] = self.pic_file_id.to_alipay_dict()
  57. else:
  58. params['pic_file_id'] = self.pic_file_id
  59. if self.three_dimension:
  60. if hasattr(self.three_dimension, 'to_alipay_dict'):
  61. params['three_dimension'] = self.three_dimension.to_alipay_dict()
  62. else:
  63. params['three_dimension'] = self.three_dimension
  64. if self.thumbnails:
  65. if hasattr(self.thumbnails, 'to_alipay_dict'):
  66. params['thumbnails'] = self.thumbnails.to_alipay_dict()
  67. else:
  68. params['thumbnails'] = self.thumbnails
  69. return params
  70. @staticmethod
  71. def from_alipay_dict(d):
  72. if not d:
  73. return None
  74. o = AlgorithmGoodsInfo()
  75. if 'algorithm_goods_id' in d:
  76. o.algorithm_goods_id = d['algorithm_goods_id']
  77. if 'gif_file_id' in d:
  78. o.gif_file_id = d['gif_file_id']
  79. if 'pic_file_id' in d:
  80. o.pic_file_id = d['pic_file_id']
  81. if 'three_dimension' in d:
  82. o.three_dimension = d['three_dimension']
  83. if 'thumbnails' in d:
  84. o.thumbnails = d['thumbnails']
  85. return o