AdMaterialResultDTO.py 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AdMaterialResultDTO(object):
  6. def __init__(self):
  7. self._height = None
  8. self._index = None
  9. self._material_type = None
  10. self._mt_signature = None
  11. self._play_time = None
  12. self._url = None
  13. self._width = None
  14. @property
  15. def height(self):
  16. return self._height
  17. @height.setter
  18. def height(self, value):
  19. self._height = value
  20. @property
  21. def index(self):
  22. return self._index
  23. @index.setter
  24. def index(self, value):
  25. self._index = value
  26. @property
  27. def material_type(self):
  28. return self._material_type
  29. @material_type.setter
  30. def material_type(self, value):
  31. self._material_type = value
  32. @property
  33. def mt_signature(self):
  34. return self._mt_signature
  35. @mt_signature.setter
  36. def mt_signature(self, value):
  37. self._mt_signature = value
  38. @property
  39. def play_time(self):
  40. return self._play_time
  41. @play_time.setter
  42. def play_time(self, value):
  43. self._play_time = value
  44. @property
  45. def url(self):
  46. return self._url
  47. @url.setter
  48. def url(self, value):
  49. self._url = value
  50. @property
  51. def width(self):
  52. return self._width
  53. @width.setter
  54. def width(self, value):
  55. self._width = value
  56. def to_alipay_dict(self):
  57. params = dict()
  58. if self.height:
  59. if hasattr(self.height, 'to_alipay_dict'):
  60. params['height'] = self.height.to_alipay_dict()
  61. else:
  62. params['height'] = self.height
  63. if self.index:
  64. if hasattr(self.index, 'to_alipay_dict'):
  65. params['index'] = self.index.to_alipay_dict()
  66. else:
  67. params['index'] = self.index
  68. if self.material_type:
  69. if hasattr(self.material_type, 'to_alipay_dict'):
  70. params['material_type'] = self.material_type.to_alipay_dict()
  71. else:
  72. params['material_type'] = self.material_type
  73. if self.mt_signature:
  74. if hasattr(self.mt_signature, 'to_alipay_dict'):
  75. params['mt_signature'] = self.mt_signature.to_alipay_dict()
  76. else:
  77. params['mt_signature'] = self.mt_signature
  78. if self.play_time:
  79. if hasattr(self.play_time, 'to_alipay_dict'):
  80. params['play_time'] = self.play_time.to_alipay_dict()
  81. else:
  82. params['play_time'] = self.play_time
  83. if self.url:
  84. if hasattr(self.url, 'to_alipay_dict'):
  85. params['url'] = self.url.to_alipay_dict()
  86. else:
  87. params['url'] = self.url
  88. if self.width:
  89. if hasattr(self.width, 'to_alipay_dict'):
  90. params['width'] = self.width.to_alipay_dict()
  91. else:
  92. params['width'] = self.width
  93. return params
  94. @staticmethod
  95. def from_alipay_dict(d):
  96. if not d:
  97. return None
  98. o = AdMaterialResultDTO()
  99. if 'height' in d:
  100. o.height = d['height']
  101. if 'index' in d:
  102. o.index = d['index']
  103. if 'material_type' in d:
  104. o.material_type = d['material_type']
  105. if 'mt_signature' in d:
  106. o.mt_signature = d['mt_signature']
  107. if 'play_time' in d:
  108. o.play_time = d['play_time']
  109. if 'url' in d:
  110. o.url = d['url']
  111. if 'width' in d:
  112. o.width = d['width']
  113. return o