NewsfeedMediaGiftInfo.py 4.5 KB

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