AlipayUserCertdocSyncModel.py 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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.OpenCertPic import OpenCertPic
  6. class AlipayUserCertdocSyncModel(object):
  7. def __init__(self):
  8. self._cert_no = None
  9. self._cert_type = None
  10. self._ext_info = None
  11. self._name = None
  12. self._pic_list = None
  13. self._status = None
  14. self._user_id = None
  15. @property
  16. def cert_no(self):
  17. return self._cert_no
  18. @cert_no.setter
  19. def cert_no(self, value):
  20. self._cert_no = value
  21. @property
  22. def cert_type(self):
  23. return self._cert_type
  24. @cert_type.setter
  25. def cert_type(self, value):
  26. self._cert_type = value
  27. @property
  28. def ext_info(self):
  29. return self._ext_info
  30. @ext_info.setter
  31. def ext_info(self, value):
  32. self._ext_info = value
  33. @property
  34. def name(self):
  35. return self._name
  36. @name.setter
  37. def name(self, value):
  38. self._name = value
  39. @property
  40. def pic_list(self):
  41. return self._pic_list
  42. @pic_list.setter
  43. def pic_list(self, value):
  44. if isinstance(value, list):
  45. self._pic_list = list()
  46. for i in value:
  47. if isinstance(i, OpenCertPic):
  48. self._pic_list.append(i)
  49. else:
  50. self._pic_list.append(OpenCertPic.from_alipay_dict(i))
  51. @property
  52. def status(self):
  53. return self._status
  54. @status.setter
  55. def status(self, value):
  56. self._status = value
  57. @property
  58. def user_id(self):
  59. return self._user_id
  60. @user_id.setter
  61. def user_id(self, value):
  62. self._user_id = value
  63. def to_alipay_dict(self):
  64. params = dict()
  65. if self.cert_no:
  66. if hasattr(self.cert_no, 'to_alipay_dict'):
  67. params['cert_no'] = self.cert_no.to_alipay_dict()
  68. else:
  69. params['cert_no'] = self.cert_no
  70. if self.cert_type:
  71. if hasattr(self.cert_type, 'to_alipay_dict'):
  72. params['cert_type'] = self.cert_type.to_alipay_dict()
  73. else:
  74. params['cert_type'] = self.cert_type
  75. if self.ext_info:
  76. if hasattr(self.ext_info, 'to_alipay_dict'):
  77. params['ext_info'] = self.ext_info.to_alipay_dict()
  78. else:
  79. params['ext_info'] = self.ext_info
  80. if self.name:
  81. if hasattr(self.name, 'to_alipay_dict'):
  82. params['name'] = self.name.to_alipay_dict()
  83. else:
  84. params['name'] = self.name
  85. if self.pic_list:
  86. if isinstance(self.pic_list, list):
  87. for i in range(0, len(self.pic_list)):
  88. element = self.pic_list[i]
  89. if hasattr(element, 'to_alipay_dict'):
  90. self.pic_list[i] = element.to_alipay_dict()
  91. if hasattr(self.pic_list, 'to_alipay_dict'):
  92. params['pic_list'] = self.pic_list.to_alipay_dict()
  93. else:
  94. params['pic_list'] = self.pic_list
  95. if self.status:
  96. if hasattr(self.status, 'to_alipay_dict'):
  97. params['status'] = self.status.to_alipay_dict()
  98. else:
  99. params['status'] = self.status
  100. if self.user_id:
  101. if hasattr(self.user_id, 'to_alipay_dict'):
  102. params['user_id'] = self.user_id.to_alipay_dict()
  103. else:
  104. params['user_id'] = self.user_id
  105. return params
  106. @staticmethod
  107. def from_alipay_dict(d):
  108. if not d:
  109. return None
  110. o = AlipayUserCertdocSyncModel()
  111. if 'cert_no' in d:
  112. o.cert_no = d['cert_no']
  113. if 'cert_type' in d:
  114. o.cert_type = d['cert_type']
  115. if 'ext_info' in d:
  116. o.ext_info = d['ext_info']
  117. if 'name' in d:
  118. o.name = d['name']
  119. if 'pic_list' in d:
  120. o.pic_list = d['pic_list']
  121. if 'status' in d:
  122. o.status = d['status']
  123. if 'user_id' in d:
  124. o.user_id = d['user_id']
  125. return o