GavintestNewLeveaOne.py 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class GavintestNewLeveaOne(object):
  6. def __init__(self):
  7. self._boolen = None
  8. self._ces = None
  9. self._des = None
  10. self._str = None
  11. @property
  12. def boolen(self):
  13. return self._boolen
  14. @boolen.setter
  15. def boolen(self, value):
  16. self._boolen = value
  17. @property
  18. def ces(self):
  19. return self._ces
  20. @ces.setter
  21. def ces(self, value):
  22. if isinstance(value, list):
  23. self._ces = list()
  24. for i in value:
  25. self._ces.append(i)
  26. @property
  27. def des(self):
  28. return self._des
  29. @des.setter
  30. def des(self, value):
  31. self._des = value
  32. @property
  33. def str(self):
  34. return self._str
  35. @str.setter
  36. def str(self, value):
  37. if isinstance(value, list):
  38. self._str = list()
  39. for i in value:
  40. self._str.append(i)
  41. def to_alipay_dict(self):
  42. params = dict()
  43. if self.boolen:
  44. if hasattr(self.boolen, 'to_alipay_dict'):
  45. params['boolen'] = self.boolen.to_alipay_dict()
  46. else:
  47. params['boolen'] = self.boolen
  48. if self.ces:
  49. if isinstance(self.ces, list):
  50. for i in range(0, len(self.ces)):
  51. element = self.ces[i]
  52. if hasattr(element, 'to_alipay_dict'):
  53. self.ces[i] = element.to_alipay_dict()
  54. if hasattr(self.ces, 'to_alipay_dict'):
  55. params['ces'] = self.ces.to_alipay_dict()
  56. else:
  57. params['ces'] = self.ces
  58. if self.des:
  59. if hasattr(self.des, 'to_alipay_dict'):
  60. params['des'] = self.des.to_alipay_dict()
  61. else:
  62. params['des'] = self.des
  63. if self.str:
  64. if isinstance(self.str, list):
  65. for i in range(0, len(self.str)):
  66. element = self.str[i]
  67. if hasattr(element, 'to_alipay_dict'):
  68. self.str[i] = element.to_alipay_dict()
  69. if hasattr(self.str, 'to_alipay_dict'):
  70. params['str'] = self.str.to_alipay_dict()
  71. else:
  72. params['str'] = self.str
  73. return params
  74. @staticmethod
  75. def from_alipay_dict(d):
  76. if not d:
  77. return None
  78. o = GavintestNewLeveaOne()
  79. if 'boolen' in d:
  80. o.boolen = d['boolen']
  81. if 'ces' in d:
  82. o.ces = d['ces']
  83. if 'des' in d:
  84. o.des = d['des']
  85. if 'str' in d:
  86. o.str = d['str']
  87. return o