AlipayEcoPrinterStatusQueryModel.py 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AlipayEcoPrinterStatusQueryModel(object):
  6. def __init__(self):
  7. self._client_id = None
  8. self._client_secret = None
  9. self._eprint_token = None
  10. self._machine_code = None
  11. @property
  12. def client_id(self):
  13. return self._client_id
  14. @client_id.setter
  15. def client_id(self, value):
  16. self._client_id = value
  17. @property
  18. def client_secret(self):
  19. return self._client_secret
  20. @client_secret.setter
  21. def client_secret(self, value):
  22. self._client_secret = value
  23. @property
  24. def eprint_token(self):
  25. return self._eprint_token
  26. @eprint_token.setter
  27. def eprint_token(self, value):
  28. self._eprint_token = value
  29. @property
  30. def machine_code(self):
  31. return self._machine_code
  32. @machine_code.setter
  33. def machine_code(self, value):
  34. self._machine_code = value
  35. def to_alipay_dict(self):
  36. params = dict()
  37. if self.client_id:
  38. if hasattr(self.client_id, 'to_alipay_dict'):
  39. params['client_id'] = self.client_id.to_alipay_dict()
  40. else:
  41. params['client_id'] = self.client_id
  42. if self.client_secret:
  43. if hasattr(self.client_secret, 'to_alipay_dict'):
  44. params['client_secret'] = self.client_secret.to_alipay_dict()
  45. else:
  46. params['client_secret'] = self.client_secret
  47. if self.eprint_token:
  48. if hasattr(self.eprint_token, 'to_alipay_dict'):
  49. params['eprint_token'] = self.eprint_token.to_alipay_dict()
  50. else:
  51. params['eprint_token'] = self.eprint_token
  52. if self.machine_code:
  53. if hasattr(self.machine_code, 'to_alipay_dict'):
  54. params['machine_code'] = self.machine_code.to_alipay_dict()
  55. else:
  56. params['machine_code'] = self.machine_code
  57. return params
  58. @staticmethod
  59. def from_alipay_dict(d):
  60. if not d:
  61. return None
  62. o = AlipayEcoPrinterStatusQueryModel()
  63. if 'client_id' in d:
  64. o.client_id = d['client_id']
  65. if 'client_secret' in d:
  66. o.client_secret = d['client_secret']
  67. if 'eprint_token' in d:
  68. o.eprint_token = d['eprint_token']
  69. if 'machine_code' in d:
  70. o.machine_code = d['machine_code']
  71. return o