AlipaySecurityProdDesQueryModel.py 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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.GavinTestnew import GavinTestnew
  6. class AlipaySecurityProdDesQueryModel(object):
  7. def __init__(self):
  8. self._com = None
  9. self._test = None
  10. @property
  11. def com(self):
  12. return self._com
  13. @com.setter
  14. def com(self, value):
  15. if isinstance(value, GavinTestnew):
  16. self._com = value
  17. else:
  18. self._com = GavinTestnew.from_alipay_dict(value)
  19. @property
  20. def test(self):
  21. return self._test
  22. @test.setter
  23. def test(self, value):
  24. if isinstance(value, list):
  25. self._test = list()
  26. for i in value:
  27. self._test.append(i)
  28. def to_alipay_dict(self):
  29. params = dict()
  30. if self.com:
  31. if hasattr(self.com, 'to_alipay_dict'):
  32. params['com'] = self.com.to_alipay_dict()
  33. else:
  34. params['com'] = self.com
  35. if self.test:
  36. if isinstance(self.test, list):
  37. for i in range(0, len(self.test)):
  38. element = self.test[i]
  39. if hasattr(element, 'to_alipay_dict'):
  40. self.test[i] = element.to_alipay_dict()
  41. if hasattr(self.test, 'to_alipay_dict'):
  42. params['test'] = self.test.to_alipay_dict()
  43. else:
  44. params['test'] = self.test
  45. return params
  46. @staticmethod
  47. def from_alipay_dict(d):
  48. if not d:
  49. return None
  50. o = AlipaySecurityProdDesQueryModel()
  51. if 'com' in d:
  52. o.com = d['com']
  53. if 'test' in d:
  54. o.test = d['test']
  55. return o