KoubeiMarketingCampaignRetailDmCreateModel.py 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class KoubeiMarketingCampaignRetailDmCreateModel(object):
  6. def __init__(self):
  7. self._action_url = None
  8. self._activity_end_time = None
  9. self._activity_start_time = None
  10. self._brief = None
  11. self._campaign_type = None
  12. self._coupon_type = None
  13. self._description = None
  14. self._ext_info = None
  15. self._image_id = None
  16. self._item_brand = None
  17. self._item_category = None
  18. self._item_code = None
  19. self._item_name = None
  20. self._member_only = None
  21. self._shop_ids = None
  22. self._thumbnail_image_id = None
  23. @property
  24. def action_url(self):
  25. return self._action_url
  26. @action_url.setter
  27. def action_url(self, value):
  28. self._action_url = value
  29. @property
  30. def activity_end_time(self):
  31. return self._activity_end_time
  32. @activity_end_time.setter
  33. def activity_end_time(self, value):
  34. self._activity_end_time = value
  35. @property
  36. def activity_start_time(self):
  37. return self._activity_start_time
  38. @activity_start_time.setter
  39. def activity_start_time(self, value):
  40. self._activity_start_time = value
  41. @property
  42. def brief(self):
  43. return self._brief
  44. @brief.setter
  45. def brief(self, value):
  46. self._brief = value
  47. @property
  48. def campaign_type(self):
  49. return self._campaign_type
  50. @campaign_type.setter
  51. def campaign_type(self, value):
  52. self._campaign_type = value
  53. @property
  54. def coupon_type(self):
  55. return self._coupon_type
  56. @coupon_type.setter
  57. def coupon_type(self, value):
  58. self._coupon_type = value
  59. @property
  60. def description(self):
  61. return self._description
  62. @description.setter
  63. def description(self, value):
  64. self._description = value
  65. @property
  66. def ext_info(self):
  67. return self._ext_info
  68. @ext_info.setter
  69. def ext_info(self, value):
  70. self._ext_info = value
  71. @property
  72. def image_id(self):
  73. return self._image_id
  74. @image_id.setter
  75. def image_id(self, value):
  76. self._image_id = value
  77. @property
  78. def item_brand(self):
  79. return self._item_brand
  80. @item_brand.setter
  81. def item_brand(self, value):
  82. self._item_brand = value
  83. @property
  84. def item_category(self):
  85. return self._item_category
  86. @item_category.setter
  87. def item_category(self, value):
  88. self._item_category = value
  89. @property
  90. def item_code(self):
  91. return self._item_code
  92. @item_code.setter
  93. def item_code(self, value):
  94. self._item_code = value
  95. @property
  96. def item_name(self):
  97. return self._item_name
  98. @item_name.setter
  99. def item_name(self, value):
  100. self._item_name = value
  101. @property
  102. def member_only(self):
  103. return self._member_only
  104. @member_only.setter
  105. def member_only(self, value):
  106. self._member_only = value
  107. @property
  108. def shop_ids(self):
  109. return self._shop_ids
  110. @shop_ids.setter
  111. def shop_ids(self, value):
  112. if isinstance(value, list):
  113. self._shop_ids = list()
  114. for i in value:
  115. self._shop_ids.append(i)
  116. @property
  117. def thumbnail_image_id(self):
  118. return self._thumbnail_image_id
  119. @thumbnail_image_id.setter
  120. def thumbnail_image_id(self, value):
  121. self._thumbnail_image_id = value
  122. def to_alipay_dict(self):
  123. params = dict()
  124. if self.action_url:
  125. if hasattr(self.action_url, 'to_alipay_dict'):
  126. params['action_url'] = self.action_url.to_alipay_dict()
  127. else:
  128. params['action_url'] = self.action_url
  129. if self.activity_end_time:
  130. if hasattr(self.activity_end_time, 'to_alipay_dict'):
  131. params['activity_end_time'] = self.activity_end_time.to_alipay_dict()
  132. else:
  133. params['activity_end_time'] = self.activity_end_time
  134. if self.activity_start_time:
  135. if hasattr(self.activity_start_time, 'to_alipay_dict'):
  136. params['activity_start_time'] = self.activity_start_time.to_alipay_dict()
  137. else:
  138. params['activity_start_time'] = self.activity_start_time
  139. if self.brief:
  140. if hasattr(self.brief, 'to_alipay_dict'):
  141. params['brief'] = self.brief.to_alipay_dict()
  142. else:
  143. params['brief'] = self.brief
  144. if self.campaign_type:
  145. if hasattr(self.campaign_type, 'to_alipay_dict'):
  146. params['campaign_type'] = self.campaign_type.to_alipay_dict()
  147. else:
  148. params['campaign_type'] = self.campaign_type
  149. if self.coupon_type:
  150. if hasattr(self.coupon_type, 'to_alipay_dict'):
  151. params['coupon_type'] = self.coupon_type.to_alipay_dict()
  152. else:
  153. params['coupon_type'] = self.coupon_type
  154. if self.description:
  155. if hasattr(self.description, 'to_alipay_dict'):
  156. params['description'] = self.description.to_alipay_dict()
  157. else:
  158. params['description'] = self.description
  159. if self.ext_info:
  160. if hasattr(self.ext_info, 'to_alipay_dict'):
  161. params['ext_info'] = self.ext_info.to_alipay_dict()
  162. else:
  163. params['ext_info'] = self.ext_info
  164. if self.image_id:
  165. if hasattr(self.image_id, 'to_alipay_dict'):
  166. params['image_id'] = self.image_id.to_alipay_dict()
  167. else:
  168. params['image_id'] = self.image_id
  169. if self.item_brand:
  170. if hasattr(self.item_brand, 'to_alipay_dict'):
  171. params['item_brand'] = self.item_brand.to_alipay_dict()
  172. else:
  173. params['item_brand'] = self.item_brand
  174. if self.item_category:
  175. if hasattr(self.item_category, 'to_alipay_dict'):
  176. params['item_category'] = self.item_category.to_alipay_dict()
  177. else:
  178. params['item_category'] = self.item_category
  179. if self.item_code:
  180. if hasattr(self.item_code, 'to_alipay_dict'):
  181. params['item_code'] = self.item_code.to_alipay_dict()
  182. else:
  183. params['item_code'] = self.item_code
  184. if self.item_name:
  185. if hasattr(self.item_name, 'to_alipay_dict'):
  186. params['item_name'] = self.item_name.to_alipay_dict()
  187. else:
  188. params['item_name'] = self.item_name
  189. if self.member_only:
  190. if hasattr(self.member_only, 'to_alipay_dict'):
  191. params['member_only'] = self.member_only.to_alipay_dict()
  192. else:
  193. params['member_only'] = self.member_only
  194. if self.shop_ids:
  195. if isinstance(self.shop_ids, list):
  196. for i in range(0, len(self.shop_ids)):
  197. element = self.shop_ids[i]
  198. if hasattr(element, 'to_alipay_dict'):
  199. self.shop_ids[i] = element.to_alipay_dict()
  200. if hasattr(self.shop_ids, 'to_alipay_dict'):
  201. params['shop_ids'] = self.shop_ids.to_alipay_dict()
  202. else:
  203. params['shop_ids'] = self.shop_ids
  204. if self.thumbnail_image_id:
  205. if hasattr(self.thumbnail_image_id, 'to_alipay_dict'):
  206. params['thumbnail_image_id'] = self.thumbnail_image_id.to_alipay_dict()
  207. else:
  208. params['thumbnail_image_id'] = self.thumbnail_image_id
  209. return params
  210. @staticmethod
  211. def from_alipay_dict(d):
  212. if not d:
  213. return None
  214. o = KoubeiMarketingCampaignRetailDmCreateModel()
  215. if 'action_url' in d:
  216. o.action_url = d['action_url']
  217. if 'activity_end_time' in d:
  218. o.activity_end_time = d['activity_end_time']
  219. if 'activity_start_time' in d:
  220. o.activity_start_time = d['activity_start_time']
  221. if 'brief' in d:
  222. o.brief = d['brief']
  223. if 'campaign_type' in d:
  224. o.campaign_type = d['campaign_type']
  225. if 'coupon_type' in d:
  226. o.coupon_type = d['coupon_type']
  227. if 'description' in d:
  228. o.description = d['description']
  229. if 'ext_info' in d:
  230. o.ext_info = d['ext_info']
  231. if 'image_id' in d:
  232. o.image_id = d['image_id']
  233. if 'item_brand' in d:
  234. o.item_brand = d['item_brand']
  235. if 'item_category' in d:
  236. o.item_category = d['item_category']
  237. if 'item_code' in d:
  238. o.item_code = d['item_code']
  239. if 'item_name' in d:
  240. o.item_name = d['item_name']
  241. if 'member_only' in d:
  242. o.member_only = d['member_only']
  243. if 'shop_ids' in d:
  244. o.shop_ids = d['shop_ids']
  245. if 'thumbnail_image_id' in d:
  246. o.thumbnail_image_id = d['thumbnail_image_id']
  247. return o