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