AlipayDataPrinterTaskCancelModel.py 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AlipayDataPrinterTaskCancelModel(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. self._order_id = None
  12. @property
  13. def access_token(self):
  14. return self._access_token
  15. @access_token.setter
  16. def access_token(self, value):
  17. self._access_token = value
  18. @property
  19. def client_id(self):
  20. return self._client_id
  21. @client_id.setter
  22. def client_id(self, value):
  23. self._client_id = value
  24. @property
  25. def client_secret(self):
  26. return self._client_secret
  27. @client_secret.setter
  28. def client_secret(self, value):
  29. self._client_secret = value
  30. @property
  31. def device_sn(self):
  32. return self._device_sn
  33. @device_sn.setter
  34. def device_sn(self, value):
  35. self._device_sn = value
  36. @property
  37. def order_id(self):
  38. return self._order_id
  39. @order_id.setter
  40. def order_id(self, value):
  41. self._order_id = value
  42. def to_alipay_dict(self):
  43. params = dict()
  44. if self.access_token:
  45. if hasattr(self.access_token, 'to_alipay_dict'):
  46. params['access_token'] = self.access_token.to_alipay_dict()
  47. else:
  48. params['access_token'] = self.access_token
  49. if self.client_id:
  50. if hasattr(self.client_id, 'to_alipay_dict'):
  51. params['client_id'] = self.client_id.to_alipay_dict()
  52. else:
  53. params['client_id'] = self.client_id
  54. if self.client_secret:
  55. if hasattr(self.client_secret, 'to_alipay_dict'):
  56. params['client_secret'] = self.client_secret.to_alipay_dict()
  57. else:
  58. params['client_secret'] = self.client_secret
  59. if self.device_sn:
  60. if hasattr(self.device_sn, 'to_alipay_dict'):
  61. params['device_sn'] = self.device_sn.to_alipay_dict()
  62. else:
  63. params['device_sn'] = self.device_sn
  64. if self.order_id:
  65. if hasattr(self.order_id, 'to_alipay_dict'):
  66. params['order_id'] = self.order_id.to_alipay_dict()
  67. else:
  68. params['order_id'] = self.order_id
  69. return params
  70. @staticmethod
  71. def from_alipay_dict(d):
  72. if not d:
  73. return None
  74. o = AlipayDataPrinterTaskCancelModel()
  75. if 'access_token' in d:
  76. o.access_token = d['access_token']
  77. if 'client_id' in d:
  78. o.client_id = d['client_id']
  79. if 'client_secret' in d:
  80. o.client_secret = d['client_secret']
  81. if 'device_sn' in d:
  82. o.device_sn = d['device_sn']
  83. if 'order_id' in d:
  84. o.order_id = d['order_id']
  85. return o