AlipayOpenAppReproCesCreateModel.py 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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.GavintestNewLeveaOne import GavintestNewLeveaOne
  6. from alipay.aop.api.domain.Gavinmed import Gavinmed
  7. class AlipayOpenAppReproCesCreateModel(object):
  8. def __init__(self):
  9. self._comp = None
  10. self._nam = None
  11. self._str = None
  12. @property
  13. def comp(self):
  14. return self._comp
  15. @comp.setter
  16. def comp(self, value):
  17. if isinstance(value, list):
  18. self._comp = list()
  19. for i in value:
  20. if isinstance(i, GavintestNewLeveaOne):
  21. self._comp.append(i)
  22. else:
  23. self._comp.append(GavintestNewLeveaOne.from_alipay_dict(i))
  24. @property
  25. def nam(self):
  26. return self._nam
  27. @nam.setter
  28. def nam(self, value):
  29. if isinstance(value, Gavinmed):
  30. self._nam = value
  31. else:
  32. self._nam = Gavinmed.from_alipay_dict(value)
  33. @property
  34. def str(self):
  35. return self._str
  36. @str.setter
  37. def str(self, value):
  38. if isinstance(value, list):
  39. self._str = list()
  40. for i in value:
  41. self._str.append(i)
  42. def to_alipay_dict(self):
  43. params = dict()
  44. if self.comp:
  45. if isinstance(self.comp, list):
  46. for i in range(0, len(self.comp)):
  47. element = self.comp[i]
  48. if hasattr(element, 'to_alipay_dict'):
  49. self.comp[i] = element.to_alipay_dict()
  50. if hasattr(self.comp, 'to_alipay_dict'):
  51. params['comp'] = self.comp.to_alipay_dict()
  52. else:
  53. params['comp'] = self.comp
  54. if self.nam:
  55. if hasattr(self.nam, 'to_alipay_dict'):
  56. params['nam'] = self.nam.to_alipay_dict()
  57. else:
  58. params['nam'] = self.nam
  59. if self.str:
  60. if isinstance(self.str, list):
  61. for i in range(0, len(self.str)):
  62. element = self.str[i]
  63. if hasattr(element, 'to_alipay_dict'):
  64. self.str[i] = element.to_alipay_dict()
  65. if hasattr(self.str, 'to_alipay_dict'):
  66. params['str'] = self.str.to_alipay_dict()
  67. else:
  68. params['str'] = self.str
  69. return params
  70. @staticmethod
  71. def from_alipay_dict(d):
  72. if not d:
  73. return None
  74. o = AlipayOpenAppReproCesCreateModel()
  75. if 'comp' in d:
  76. o.comp = d['comp']
  77. if 'nam' in d:
  78. o.nam = d['nam']
  79. if 'str' in d:
  80. o.str = d['str']
  81. return o