KoubeiCraftsmanDataProviderCreateModel.py 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  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.CraftsmanShopRelationOpenModel import CraftsmanShopRelationOpenModel
  6. class KoubeiCraftsmanDataProviderCreateModel(object):
  7. def __init__(self):
  8. self._account = None
  9. self._auth_code = None
  10. self._avatar = None
  11. self._career_begin = None
  12. self._careers = None
  13. self._introduction = None
  14. self._name = None
  15. self._nick_name = None
  16. self._out_craftsman_id = None
  17. self._shop_relations = None
  18. self._specialities = None
  19. self._tel_num = None
  20. self._title = None
  21. @property
  22. def account(self):
  23. return self._account
  24. @account.setter
  25. def account(self, value):
  26. self._account = value
  27. @property
  28. def auth_code(self):
  29. return self._auth_code
  30. @auth_code.setter
  31. def auth_code(self, value):
  32. self._auth_code = value
  33. @property
  34. def avatar(self):
  35. return self._avatar
  36. @avatar.setter
  37. def avatar(self, value):
  38. self._avatar = value
  39. @property
  40. def career_begin(self):
  41. return self._career_begin
  42. @career_begin.setter
  43. def career_begin(self, value):
  44. self._career_begin = value
  45. @property
  46. def careers(self):
  47. return self._careers
  48. @careers.setter
  49. def careers(self, value):
  50. if isinstance(value, list):
  51. self._careers = list()
  52. for i in value:
  53. self._careers.append(i)
  54. @property
  55. def introduction(self):
  56. return self._introduction
  57. @introduction.setter
  58. def introduction(self, value):
  59. self._introduction = value
  60. @property
  61. def name(self):
  62. return self._name
  63. @name.setter
  64. def name(self, value):
  65. self._name = value
  66. @property
  67. def nick_name(self):
  68. return self._nick_name
  69. @nick_name.setter
  70. def nick_name(self, value):
  71. self._nick_name = value
  72. @property
  73. def out_craftsman_id(self):
  74. return self._out_craftsman_id
  75. @out_craftsman_id.setter
  76. def out_craftsman_id(self, value):
  77. self._out_craftsman_id = value
  78. @property
  79. def shop_relations(self):
  80. return self._shop_relations
  81. @shop_relations.setter
  82. def shop_relations(self, value):
  83. if isinstance(value, list):
  84. self._shop_relations = list()
  85. for i in value:
  86. if isinstance(i, CraftsmanShopRelationOpenModel):
  87. self._shop_relations.append(i)
  88. else:
  89. self._shop_relations.append(CraftsmanShopRelationOpenModel.from_alipay_dict(i))
  90. @property
  91. def specialities(self):
  92. return self._specialities
  93. @specialities.setter
  94. def specialities(self, value):
  95. self._specialities = value
  96. @property
  97. def tel_num(self):
  98. return self._tel_num
  99. @tel_num.setter
  100. def tel_num(self, value):
  101. self._tel_num = value
  102. @property
  103. def title(self):
  104. return self._title
  105. @title.setter
  106. def title(self, value):
  107. self._title = value
  108. def to_alipay_dict(self):
  109. params = dict()
  110. if self.account:
  111. if hasattr(self.account, 'to_alipay_dict'):
  112. params['account'] = self.account.to_alipay_dict()
  113. else:
  114. params['account'] = self.account
  115. if self.auth_code:
  116. if hasattr(self.auth_code, 'to_alipay_dict'):
  117. params['auth_code'] = self.auth_code.to_alipay_dict()
  118. else:
  119. params['auth_code'] = self.auth_code
  120. if self.avatar:
  121. if hasattr(self.avatar, 'to_alipay_dict'):
  122. params['avatar'] = self.avatar.to_alipay_dict()
  123. else:
  124. params['avatar'] = self.avatar
  125. if self.career_begin:
  126. if hasattr(self.career_begin, 'to_alipay_dict'):
  127. params['career_begin'] = self.career_begin.to_alipay_dict()
  128. else:
  129. params['career_begin'] = self.career_begin
  130. if self.careers:
  131. if isinstance(self.careers, list):
  132. for i in range(0, len(self.careers)):
  133. element = self.careers[i]
  134. if hasattr(element, 'to_alipay_dict'):
  135. self.careers[i] = element.to_alipay_dict()
  136. if hasattr(self.careers, 'to_alipay_dict'):
  137. params['careers'] = self.careers.to_alipay_dict()
  138. else:
  139. params['careers'] = self.careers
  140. if self.introduction:
  141. if hasattr(self.introduction, 'to_alipay_dict'):
  142. params['introduction'] = self.introduction.to_alipay_dict()
  143. else:
  144. params['introduction'] = self.introduction
  145. if self.name:
  146. if hasattr(self.name, 'to_alipay_dict'):
  147. params['name'] = self.name.to_alipay_dict()
  148. else:
  149. params['name'] = self.name
  150. if self.nick_name:
  151. if hasattr(self.nick_name, 'to_alipay_dict'):
  152. params['nick_name'] = self.nick_name.to_alipay_dict()
  153. else:
  154. params['nick_name'] = self.nick_name
  155. if self.out_craftsman_id:
  156. if hasattr(self.out_craftsman_id, 'to_alipay_dict'):
  157. params['out_craftsman_id'] = self.out_craftsman_id.to_alipay_dict()
  158. else:
  159. params['out_craftsman_id'] = self.out_craftsman_id
  160. if self.shop_relations:
  161. if isinstance(self.shop_relations, list):
  162. for i in range(0, len(self.shop_relations)):
  163. element = self.shop_relations[i]
  164. if hasattr(element, 'to_alipay_dict'):
  165. self.shop_relations[i] = element.to_alipay_dict()
  166. if hasattr(self.shop_relations, 'to_alipay_dict'):
  167. params['shop_relations'] = self.shop_relations.to_alipay_dict()
  168. else:
  169. params['shop_relations'] = self.shop_relations
  170. if self.specialities:
  171. if hasattr(self.specialities, 'to_alipay_dict'):
  172. params['specialities'] = self.specialities.to_alipay_dict()
  173. else:
  174. params['specialities'] = self.specialities
  175. if self.tel_num:
  176. if hasattr(self.tel_num, 'to_alipay_dict'):
  177. params['tel_num'] = self.tel_num.to_alipay_dict()
  178. else:
  179. params['tel_num'] = self.tel_num
  180. if self.title:
  181. if hasattr(self.title, 'to_alipay_dict'):
  182. params['title'] = self.title.to_alipay_dict()
  183. else:
  184. params['title'] = self.title
  185. return params
  186. @staticmethod
  187. def from_alipay_dict(d):
  188. if not d:
  189. return None
  190. o = KoubeiCraftsmanDataProviderCreateModel()
  191. if 'account' in d:
  192. o.account = d['account']
  193. if 'auth_code' in d:
  194. o.auth_code = d['auth_code']
  195. if 'avatar' in d:
  196. o.avatar = d['avatar']
  197. if 'career_begin' in d:
  198. o.career_begin = d['career_begin']
  199. if 'careers' in d:
  200. o.careers = d['careers']
  201. if 'introduction' in d:
  202. o.introduction = d['introduction']
  203. if 'name' in d:
  204. o.name = d['name']
  205. if 'nick_name' in d:
  206. o.nick_name = d['nick_name']
  207. if 'out_craftsman_id' in d:
  208. o.out_craftsman_id = d['out_craftsman_id']
  209. if 'shop_relations' in d:
  210. o.shop_relations = d['shop_relations']
  211. if 'specialities' in d:
  212. o.specialities = d['specialities']
  213. if 'tel_num' in d:
  214. o.tel_num = d['tel_num']
  215. if 'title' in d:
  216. o.title = d['title']
  217. return o