OperatorInfo.py 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class OperatorInfo(object):
  6. def __init__(self):
  7. self._operator_cert_indate = None
  8. self._operator_cert_no = None
  9. self._operator_cert_pic_back = None
  10. self._operator_cert_pic_front = None
  11. self._operator_cert_type = None
  12. self._operator_name = None
  13. @property
  14. def operator_cert_indate(self):
  15. return self._operator_cert_indate
  16. @operator_cert_indate.setter
  17. def operator_cert_indate(self, value):
  18. self._operator_cert_indate = value
  19. @property
  20. def operator_cert_no(self):
  21. return self._operator_cert_no
  22. @operator_cert_no.setter
  23. def operator_cert_no(self, value):
  24. self._operator_cert_no = value
  25. @property
  26. def operator_cert_pic_back(self):
  27. return self._operator_cert_pic_back
  28. @operator_cert_pic_back.setter
  29. def operator_cert_pic_back(self, value):
  30. self._operator_cert_pic_back = value
  31. @property
  32. def operator_cert_pic_front(self):
  33. return self._operator_cert_pic_front
  34. @operator_cert_pic_front.setter
  35. def operator_cert_pic_front(self, value):
  36. self._operator_cert_pic_front = value
  37. @property
  38. def operator_cert_type(self):
  39. return self._operator_cert_type
  40. @operator_cert_type.setter
  41. def operator_cert_type(self, value):
  42. self._operator_cert_type = value
  43. @property
  44. def operator_name(self):
  45. return self._operator_name
  46. @operator_name.setter
  47. def operator_name(self, value):
  48. self._operator_name = value
  49. def to_alipay_dict(self):
  50. params = dict()
  51. if self.operator_cert_indate:
  52. if hasattr(self.operator_cert_indate, 'to_alipay_dict'):
  53. params['operator_cert_indate'] = self.operator_cert_indate.to_alipay_dict()
  54. else:
  55. params['operator_cert_indate'] = self.operator_cert_indate
  56. if self.operator_cert_no:
  57. if hasattr(self.operator_cert_no, 'to_alipay_dict'):
  58. params['operator_cert_no'] = self.operator_cert_no.to_alipay_dict()
  59. else:
  60. params['operator_cert_no'] = self.operator_cert_no
  61. if self.operator_cert_pic_back:
  62. if hasattr(self.operator_cert_pic_back, 'to_alipay_dict'):
  63. params['operator_cert_pic_back'] = self.operator_cert_pic_back.to_alipay_dict()
  64. else:
  65. params['operator_cert_pic_back'] = self.operator_cert_pic_back
  66. if self.operator_cert_pic_front:
  67. if hasattr(self.operator_cert_pic_front, 'to_alipay_dict'):
  68. params['operator_cert_pic_front'] = self.operator_cert_pic_front.to_alipay_dict()
  69. else:
  70. params['operator_cert_pic_front'] = self.operator_cert_pic_front
  71. if self.operator_cert_type:
  72. if hasattr(self.operator_cert_type, 'to_alipay_dict'):
  73. params['operator_cert_type'] = self.operator_cert_type.to_alipay_dict()
  74. else:
  75. params['operator_cert_type'] = self.operator_cert_type
  76. if self.operator_name:
  77. if hasattr(self.operator_name, 'to_alipay_dict'):
  78. params['operator_name'] = self.operator_name.to_alipay_dict()
  79. else:
  80. params['operator_name'] = self.operator_name
  81. return params
  82. @staticmethod
  83. def from_alipay_dict(d):
  84. if not d:
  85. return None
  86. o = OperatorInfo()
  87. if 'operator_cert_indate' in d:
  88. o.operator_cert_indate = d['operator_cert_indate']
  89. if 'operator_cert_no' in d:
  90. o.operator_cert_no = d['operator_cert_no']
  91. if 'operator_cert_pic_back' in d:
  92. o.operator_cert_pic_back = d['operator_cert_pic_back']
  93. if 'operator_cert_pic_front' in d:
  94. o.operator_cert_pic_front = d['operator_cert_pic_front']
  95. if 'operator_cert_type' in d:
  96. o.operator_cert_type = d['operator_cert_type']
  97. if 'operator_name' in d:
  98. o.operator_name = d['operator_name']
  99. return o