KoubeiAdvertCommissionAdvertPurchaseModel.py 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class KoubeiAdvertCommissionAdvertPurchaseModel(object):
  6. def __init__(self):
  7. self._channel_id = None
  8. self._out_unique_id = None
  9. self._security_code = None
  10. self._tag = None
  11. self._trigger_identifies = None
  12. self._trigger_identify_type = None
  13. self._trigger_strategy = None
  14. self._user_identify = None
  15. self._user_identify_type = None
  16. @property
  17. def channel_id(self):
  18. return self._channel_id
  19. @channel_id.setter
  20. def channel_id(self, value):
  21. self._channel_id = value
  22. @property
  23. def out_unique_id(self):
  24. return self._out_unique_id
  25. @out_unique_id.setter
  26. def out_unique_id(self, value):
  27. self._out_unique_id = value
  28. @property
  29. def security_code(self):
  30. return self._security_code
  31. @security_code.setter
  32. def security_code(self, value):
  33. self._security_code = value
  34. @property
  35. def tag(self):
  36. return self._tag
  37. @tag.setter
  38. def tag(self, value):
  39. self._tag = value
  40. @property
  41. def trigger_identifies(self):
  42. return self._trigger_identifies
  43. @trigger_identifies.setter
  44. def trigger_identifies(self, value):
  45. if isinstance(value, list):
  46. self._trigger_identifies = list()
  47. for i in value:
  48. self._trigger_identifies.append(i)
  49. @property
  50. def trigger_identify_type(self):
  51. return self._trigger_identify_type
  52. @trigger_identify_type.setter
  53. def trigger_identify_type(self, value):
  54. self._trigger_identify_type = value
  55. @property
  56. def trigger_strategy(self):
  57. return self._trigger_strategy
  58. @trigger_strategy.setter
  59. def trigger_strategy(self, value):
  60. self._trigger_strategy = value
  61. @property
  62. def user_identify(self):
  63. return self._user_identify
  64. @user_identify.setter
  65. def user_identify(self, value):
  66. self._user_identify = value
  67. @property
  68. def user_identify_type(self):
  69. return self._user_identify_type
  70. @user_identify_type.setter
  71. def user_identify_type(self, value):
  72. self._user_identify_type = value
  73. def to_alipay_dict(self):
  74. params = dict()
  75. if self.channel_id:
  76. if hasattr(self.channel_id, 'to_alipay_dict'):
  77. params['channel_id'] = self.channel_id.to_alipay_dict()
  78. else:
  79. params['channel_id'] = self.channel_id
  80. if self.out_unique_id:
  81. if hasattr(self.out_unique_id, 'to_alipay_dict'):
  82. params['out_unique_id'] = self.out_unique_id.to_alipay_dict()
  83. else:
  84. params['out_unique_id'] = self.out_unique_id
  85. if self.security_code:
  86. if hasattr(self.security_code, 'to_alipay_dict'):
  87. params['security_code'] = self.security_code.to_alipay_dict()
  88. else:
  89. params['security_code'] = self.security_code
  90. if self.tag:
  91. if hasattr(self.tag, 'to_alipay_dict'):
  92. params['tag'] = self.tag.to_alipay_dict()
  93. else:
  94. params['tag'] = self.tag
  95. if self.trigger_identifies:
  96. if isinstance(self.trigger_identifies, list):
  97. for i in range(0, len(self.trigger_identifies)):
  98. element = self.trigger_identifies[i]
  99. if hasattr(element, 'to_alipay_dict'):
  100. self.trigger_identifies[i] = element.to_alipay_dict()
  101. if hasattr(self.trigger_identifies, 'to_alipay_dict'):
  102. params['trigger_identifies'] = self.trigger_identifies.to_alipay_dict()
  103. else:
  104. params['trigger_identifies'] = self.trigger_identifies
  105. if self.trigger_identify_type:
  106. if hasattr(self.trigger_identify_type, 'to_alipay_dict'):
  107. params['trigger_identify_type'] = self.trigger_identify_type.to_alipay_dict()
  108. else:
  109. params['trigger_identify_type'] = self.trigger_identify_type
  110. if self.trigger_strategy:
  111. if hasattr(self.trigger_strategy, 'to_alipay_dict'):
  112. params['trigger_strategy'] = self.trigger_strategy.to_alipay_dict()
  113. else:
  114. params['trigger_strategy'] = self.trigger_strategy
  115. if self.user_identify:
  116. if hasattr(self.user_identify, 'to_alipay_dict'):
  117. params['user_identify'] = self.user_identify.to_alipay_dict()
  118. else:
  119. params['user_identify'] = self.user_identify
  120. if self.user_identify_type:
  121. if hasattr(self.user_identify_type, 'to_alipay_dict'):
  122. params['user_identify_type'] = self.user_identify_type.to_alipay_dict()
  123. else:
  124. params['user_identify_type'] = self.user_identify_type
  125. return params
  126. @staticmethod
  127. def from_alipay_dict(d):
  128. if not d:
  129. return None
  130. o = KoubeiAdvertCommissionAdvertPurchaseModel()
  131. if 'channel_id' in d:
  132. o.channel_id = d['channel_id']
  133. if 'out_unique_id' in d:
  134. o.out_unique_id = d['out_unique_id']
  135. if 'security_code' in d:
  136. o.security_code = d['security_code']
  137. if 'tag' in d:
  138. o.tag = d['tag']
  139. if 'trigger_identifies' in d:
  140. o.trigger_identifies = d['trigger_identifies']
  141. if 'trigger_identify_type' in d:
  142. o.trigger_identify_type = d['trigger_identify_type']
  143. if 'trigger_strategy' in d:
  144. o.trigger_strategy = d['trigger_strategy']
  145. if 'user_identify' in d:
  146. o.user_identify = d['user_identify']
  147. if 'user_identify_type' in d:
  148. o.user_identify_type = d['user_identify_type']
  149. return o