AntMerchantExpandIndirectQueryModel.py 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AntMerchantExpandIndirectQueryModel(object):
  6. def __init__(self):
  7. self._external_id = None
  8. self._org_pid = None
  9. self._sub_merchant_id = None
  10. @property
  11. def external_id(self):
  12. return self._external_id
  13. @external_id.setter
  14. def external_id(self, value):
  15. self._external_id = value
  16. @property
  17. def org_pid(self):
  18. return self._org_pid
  19. @org_pid.setter
  20. def org_pid(self, value):
  21. self._org_pid = value
  22. @property
  23. def sub_merchant_id(self):
  24. return self._sub_merchant_id
  25. @sub_merchant_id.setter
  26. def sub_merchant_id(self, value):
  27. self._sub_merchant_id = value
  28. def to_alipay_dict(self):
  29. params = dict()
  30. if self.external_id:
  31. if hasattr(self.external_id, 'to_alipay_dict'):
  32. params['external_id'] = self.external_id.to_alipay_dict()
  33. else:
  34. params['external_id'] = self.external_id
  35. if self.org_pid:
  36. if hasattr(self.org_pid, 'to_alipay_dict'):
  37. params['org_pid'] = self.org_pid.to_alipay_dict()
  38. else:
  39. params['org_pid'] = self.org_pid
  40. if self.sub_merchant_id:
  41. if hasattr(self.sub_merchant_id, 'to_alipay_dict'):
  42. params['sub_merchant_id'] = self.sub_merchant_id.to_alipay_dict()
  43. else:
  44. params['sub_merchant_id'] = self.sub_merchant_id
  45. return params
  46. @staticmethod
  47. def from_alipay_dict(d):
  48. if not d:
  49. return None
  50. o = AntMerchantExpandIndirectQueryModel()
  51. if 'external_id' in d:
  52. o.external_id = d['external_id']
  53. if 'org_pid' in d:
  54. o.org_pid = d['org_pid']
  55. if 'sub_merchant_id' in d:
  56. o.sub_merchant_id = d['sub_merchant_id']
  57. return o