AlipayEcoAcceptanceTaskCreateModel.py 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. from alipay.aop.api.domain.TestCaseParam import TestCaseParam
  6. class AlipayEcoAcceptanceTaskCreateModel(object):
  7. def __init__(self):
  8. self._case_list = None
  9. self._channel = None
  10. self._company_id = None
  11. self._company_name = None
  12. self._creator_id = None
  13. self._creator_nick = None
  14. self._creator_user_type = None
  15. self._industry = None
  16. self._out_id = None
  17. self._topic = None
  18. @property
  19. def case_list(self):
  20. return self._case_list
  21. @case_list.setter
  22. def case_list(self, value):
  23. if isinstance(value, list):
  24. self._case_list = list()
  25. for i in value:
  26. if isinstance(i, TestCaseParam):
  27. self._case_list.append(i)
  28. else:
  29. self._case_list.append(TestCaseParam.from_alipay_dict(i))
  30. @property
  31. def channel(self):
  32. return self._channel
  33. @channel.setter
  34. def channel(self, value):
  35. self._channel = value
  36. @property
  37. def company_id(self):
  38. return self._company_id
  39. @company_id.setter
  40. def company_id(self, value):
  41. self._company_id = value
  42. @property
  43. def company_name(self):
  44. return self._company_name
  45. @company_name.setter
  46. def company_name(self, value):
  47. self._company_name = value
  48. @property
  49. def creator_id(self):
  50. return self._creator_id
  51. @creator_id.setter
  52. def creator_id(self, value):
  53. self._creator_id = value
  54. @property
  55. def creator_nick(self):
  56. return self._creator_nick
  57. @creator_nick.setter
  58. def creator_nick(self, value):
  59. self._creator_nick = value
  60. @property
  61. def creator_user_type(self):
  62. return self._creator_user_type
  63. @creator_user_type.setter
  64. def creator_user_type(self, value):
  65. self._creator_user_type = value
  66. @property
  67. def industry(self):
  68. return self._industry
  69. @industry.setter
  70. def industry(self, value):
  71. self._industry = value
  72. @property
  73. def out_id(self):
  74. return self._out_id
  75. @out_id.setter
  76. def out_id(self, value):
  77. self._out_id = value
  78. @property
  79. def topic(self):
  80. return self._topic
  81. @topic.setter
  82. def topic(self, value):
  83. self._topic = value
  84. def to_alipay_dict(self):
  85. params = dict()
  86. if self.case_list:
  87. if isinstance(self.case_list, list):
  88. for i in range(0, len(self.case_list)):
  89. element = self.case_list[i]
  90. if hasattr(element, 'to_alipay_dict'):
  91. self.case_list[i] = element.to_alipay_dict()
  92. if hasattr(self.case_list, 'to_alipay_dict'):
  93. params['case_list'] = self.case_list.to_alipay_dict()
  94. else:
  95. params['case_list'] = self.case_list
  96. if self.channel:
  97. if hasattr(self.channel, 'to_alipay_dict'):
  98. params['channel'] = self.channel.to_alipay_dict()
  99. else:
  100. params['channel'] = self.channel
  101. if self.company_id:
  102. if hasattr(self.company_id, 'to_alipay_dict'):
  103. params['company_id'] = self.company_id.to_alipay_dict()
  104. else:
  105. params['company_id'] = self.company_id
  106. if self.company_name:
  107. if hasattr(self.company_name, 'to_alipay_dict'):
  108. params['company_name'] = self.company_name.to_alipay_dict()
  109. else:
  110. params['company_name'] = self.company_name
  111. if self.creator_id:
  112. if hasattr(self.creator_id, 'to_alipay_dict'):
  113. params['creator_id'] = self.creator_id.to_alipay_dict()
  114. else:
  115. params['creator_id'] = self.creator_id
  116. if self.creator_nick:
  117. if hasattr(self.creator_nick, 'to_alipay_dict'):
  118. params['creator_nick'] = self.creator_nick.to_alipay_dict()
  119. else:
  120. params['creator_nick'] = self.creator_nick
  121. if self.creator_user_type:
  122. if hasattr(self.creator_user_type, 'to_alipay_dict'):
  123. params['creator_user_type'] = self.creator_user_type.to_alipay_dict()
  124. else:
  125. params['creator_user_type'] = self.creator_user_type
  126. if self.industry:
  127. if hasattr(self.industry, 'to_alipay_dict'):
  128. params['industry'] = self.industry.to_alipay_dict()
  129. else:
  130. params['industry'] = self.industry
  131. if self.out_id:
  132. if hasattr(self.out_id, 'to_alipay_dict'):
  133. params['out_id'] = self.out_id.to_alipay_dict()
  134. else:
  135. params['out_id'] = self.out_id
  136. if self.topic:
  137. if hasattr(self.topic, 'to_alipay_dict'):
  138. params['topic'] = self.topic.to_alipay_dict()
  139. else:
  140. params['topic'] = self.topic
  141. return params
  142. @staticmethod
  143. def from_alipay_dict(d):
  144. if not d:
  145. return None
  146. o = AlipayEcoAcceptanceTaskCreateModel()
  147. if 'case_list' in d:
  148. o.case_list = d['case_list']
  149. if 'channel' in d:
  150. o.channel = d['channel']
  151. if 'company_id' in d:
  152. o.company_id = d['company_id']
  153. if 'company_name' in d:
  154. o.company_name = d['company_name']
  155. if 'creator_id' in d:
  156. o.creator_id = d['creator_id']
  157. if 'creator_nick' in d:
  158. o.creator_nick = d['creator_nick']
  159. if 'creator_user_type' in d:
  160. o.creator_user_type = d['creator_user_type']
  161. if 'industry' in d:
  162. o.industry = d['industry']
  163. if 'out_id' in d:
  164. o.out_id = d['out_id']
  165. if 'topic' in d:
  166. o.topic = d['topic']
  167. return o