AlipayMarketingCdpAdvertiseCreateModel.py 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AlipayMarketingCdpAdvertiseCreateModel(object):
  6. def __init__(self):
  7. self._action_url = None
  8. self._ad_code = None
  9. self._ad_rules = None
  10. self._content = None
  11. self._content_type = None
  12. self._end_time = None
  13. self._height = None
  14. self._start_time = None
  15. @property
  16. def action_url(self):
  17. return self._action_url
  18. @action_url.setter
  19. def action_url(self, value):
  20. self._action_url = value
  21. @property
  22. def ad_code(self):
  23. return self._ad_code
  24. @ad_code.setter
  25. def ad_code(self, value):
  26. self._ad_code = value
  27. @property
  28. def ad_rules(self):
  29. return self._ad_rules
  30. @ad_rules.setter
  31. def ad_rules(self, value):
  32. self._ad_rules = value
  33. @property
  34. def content(self):
  35. return self._content
  36. @content.setter
  37. def content(self, value):
  38. self._content = value
  39. @property
  40. def content_type(self):
  41. return self._content_type
  42. @content_type.setter
  43. def content_type(self, value):
  44. self._content_type = value
  45. @property
  46. def end_time(self):
  47. return self._end_time
  48. @end_time.setter
  49. def end_time(self, value):
  50. self._end_time = value
  51. @property
  52. def height(self):
  53. return self._height
  54. @height.setter
  55. def height(self, value):
  56. self._height = value
  57. @property
  58. def start_time(self):
  59. return self._start_time
  60. @start_time.setter
  61. def start_time(self, value):
  62. self._start_time = value
  63. def to_alipay_dict(self):
  64. params = dict()
  65. if self.action_url:
  66. if hasattr(self.action_url, 'to_alipay_dict'):
  67. params['action_url'] = self.action_url.to_alipay_dict()
  68. else:
  69. params['action_url'] = self.action_url
  70. if self.ad_code:
  71. if hasattr(self.ad_code, 'to_alipay_dict'):
  72. params['ad_code'] = self.ad_code.to_alipay_dict()
  73. else:
  74. params['ad_code'] = self.ad_code
  75. if self.ad_rules:
  76. if hasattr(self.ad_rules, 'to_alipay_dict'):
  77. params['ad_rules'] = self.ad_rules.to_alipay_dict()
  78. else:
  79. params['ad_rules'] = self.ad_rules
  80. if self.content:
  81. if hasattr(self.content, 'to_alipay_dict'):
  82. params['content'] = self.content.to_alipay_dict()
  83. else:
  84. params['content'] = self.content
  85. if self.content_type:
  86. if hasattr(self.content_type, 'to_alipay_dict'):
  87. params['content_type'] = self.content_type.to_alipay_dict()
  88. else:
  89. params['content_type'] = self.content_type
  90. if self.end_time:
  91. if hasattr(self.end_time, 'to_alipay_dict'):
  92. params['end_time'] = self.end_time.to_alipay_dict()
  93. else:
  94. params['end_time'] = self.end_time
  95. if self.height:
  96. if hasattr(self.height, 'to_alipay_dict'):
  97. params['height'] = self.height.to_alipay_dict()
  98. else:
  99. params['height'] = self.height
  100. if self.start_time:
  101. if hasattr(self.start_time, 'to_alipay_dict'):
  102. params['start_time'] = self.start_time.to_alipay_dict()
  103. else:
  104. params['start_time'] = self.start_time
  105. return params
  106. @staticmethod
  107. def from_alipay_dict(d):
  108. if not d:
  109. return None
  110. o = AlipayMarketingCdpAdvertiseCreateModel()
  111. if 'action_url' in d:
  112. o.action_url = d['action_url']
  113. if 'ad_code' in d:
  114. o.ad_code = d['ad_code']
  115. if 'ad_rules' in d:
  116. o.ad_rules = d['ad_rules']
  117. if 'content' in d:
  118. o.content = d['content']
  119. if 'content_type' in d:
  120. o.content_type = d['content_type']
  121. if 'end_time' in d:
  122. o.end_time = d['end_time']
  123. if 'height' in d:
  124. o.height = d['height']
  125. if 'start_time' in d:
  126. o.start_time = d['start_time']
  127. return o