FaceSearchUserInfo.py 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class FaceSearchUserInfo(object):
  6. def __init__(self):
  7. self._customuserid = None
  8. self._merchantid = None
  9. self._merchantuid = None
  10. self._score = None
  11. @property
  12. def customuserid(self):
  13. return self._customuserid
  14. @customuserid.setter
  15. def customuserid(self, value):
  16. self._customuserid = value
  17. @property
  18. def merchantid(self):
  19. return self._merchantid
  20. @merchantid.setter
  21. def merchantid(self, value):
  22. self._merchantid = value
  23. @property
  24. def merchantuid(self):
  25. return self._merchantuid
  26. @merchantuid.setter
  27. def merchantuid(self, value):
  28. self._merchantuid = value
  29. @property
  30. def score(self):
  31. return self._score
  32. @score.setter
  33. def score(self, value):
  34. self._score = value
  35. def to_alipay_dict(self):
  36. params = dict()
  37. if self.customuserid:
  38. if hasattr(self.customuserid, 'to_alipay_dict'):
  39. params['customuserid'] = self.customuserid.to_alipay_dict()
  40. else:
  41. params['customuserid'] = self.customuserid
  42. if self.merchantid:
  43. if hasattr(self.merchantid, 'to_alipay_dict'):
  44. params['merchantid'] = self.merchantid.to_alipay_dict()
  45. else:
  46. params['merchantid'] = self.merchantid
  47. if self.merchantuid:
  48. if hasattr(self.merchantuid, 'to_alipay_dict'):
  49. params['merchantuid'] = self.merchantuid.to_alipay_dict()
  50. else:
  51. params['merchantuid'] = self.merchantuid
  52. if self.score:
  53. if hasattr(self.score, 'to_alipay_dict'):
  54. params['score'] = self.score.to_alipay_dict()
  55. else:
  56. params['score'] = self.score
  57. return params
  58. @staticmethod
  59. def from_alipay_dict(d):
  60. if not d:
  61. return None
  62. o = FaceSearchUserInfo()
  63. if 'customuserid' in d:
  64. o.customuserid = d['customuserid']
  65. if 'merchantid' in d:
  66. o.merchantid = d['merchantid']
  67. if 'merchantuid' in d:
  68. o.merchantuid = d['merchantuid']
  69. if 'score' in d:
  70. o.score = d['score']
  71. return o