AlipayDataPrinterStatusGetModel.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 AlipayDataPrinterStatusGetModel(object):
  6. def __init__(self):
  7. self._access_token = None
  8. self._client_id = None
  9. self._client_secret = None
  10. self._device_sn = None
  11. @property
  12. def access_token(self):
  13. return self._access_token
  14. @access_token.setter
  15. def access_token(self, value):
  16. self._access_token = value
  17. @property
  18. def client_id(self):
  19. return self._client_id
  20. @client_id.setter
  21. def client_id(self, value):
  22. self._client_id = value
  23. @property
  24. def client_secret(self):
  25. return self._client_secret
  26. @client_secret.setter
  27. def client_secret(self, value):
  28. self._client_secret = value
  29. @property
  30. def device_sn(self):
  31. return self._device_sn
  32. @device_sn.setter
  33. def device_sn(self, value):
  34. self._device_sn = value
  35. def to_alipay_dict(self):
  36. params = dict()
  37. if self.access_token:
  38. if hasattr(self.access_token, 'to_alipay_dict'):
  39. params['access_token'] = self.access_token.to_alipay_dict()
  40. else:
  41. params['access_token'] = self.access_token
  42. if self.client_id:
  43. if hasattr(self.client_id, 'to_alipay_dict'):
  44. params['client_id'] = self.client_id.to_alipay_dict()
  45. else:
  46. params['client_id'] = self.client_id
  47. if self.client_secret:
  48. if hasattr(self.client_secret, 'to_alipay_dict'):
  49. params['client_secret'] = self.client_secret.to_alipay_dict()
  50. else:
  51. params['client_secret'] = self.client_secret
  52. if self.device_sn:
  53. if hasattr(self.device_sn, 'to_alipay_dict'):
  54. params['device_sn'] = self.device_sn.to_alipay_dict()
  55. else:
  56. params['device_sn'] = self.device_sn
  57. return params
  58. @staticmethod
  59. def from_alipay_dict(d):
  60. if not d:
  61. return None
  62. o = AlipayDataPrinterStatusGetModel()
  63. if 'access_token' in d:
  64. o.access_token = d['access_token']
  65. if 'client_id' in d:
  66. o.client_id = d['client_id']
  67. if 'client_secret' in d:
  68. o.client_secret = d['client_secret']
  69. if 'device_sn' in d:
  70. o.device_sn = d['device_sn']
  71. return o