KoubeiMerchantOperatorBatchDeleteModel.py 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class KoubeiMerchantOperatorBatchDeleteModel(object):
  6. def __init__(self):
  7. self._auth_code = None
  8. self._operators = None
  9. @property
  10. def auth_code(self):
  11. return self._auth_code
  12. @auth_code.setter
  13. def auth_code(self, value):
  14. self._auth_code = value
  15. @property
  16. def operators(self):
  17. return self._operators
  18. @operators.setter
  19. def operators(self, value):
  20. if isinstance(value, list):
  21. self._operators = list()
  22. for i in value:
  23. self._operators.append(i)
  24. def to_alipay_dict(self):
  25. params = dict()
  26. if self.auth_code:
  27. if hasattr(self.auth_code, 'to_alipay_dict'):
  28. params['auth_code'] = self.auth_code.to_alipay_dict()
  29. else:
  30. params['auth_code'] = self.auth_code
  31. if self.operators:
  32. if isinstance(self.operators, list):
  33. for i in range(0, len(self.operators)):
  34. element = self.operators[i]
  35. if hasattr(element, 'to_alipay_dict'):
  36. self.operators[i] = element.to_alipay_dict()
  37. if hasattr(self.operators, 'to_alipay_dict'):
  38. params['operators'] = self.operators.to_alipay_dict()
  39. else:
  40. params['operators'] = self.operators
  41. return params
  42. @staticmethod
  43. def from_alipay_dict(d):
  44. if not d:
  45. return None
  46. o = KoubeiMerchantOperatorBatchDeleteModel()
  47. if 'auth_code' in d:
  48. o.auth_code = d['auth_code']
  49. if 'operators' in d:
  50. o.operators = d['operators']
  51. return o