AlipayCommerceIotMdeviceprodDeviceQueryModel.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 AlipayCommerceIotMdeviceprodDeviceQueryModel(object):
  6. def __init__(self):
  7. self._device_sn = None
  8. self._item_id = None
  9. self._supplier_sn = None
  10. @property
  11. def device_sn(self):
  12. return self._device_sn
  13. @device_sn.setter
  14. def device_sn(self, value):
  15. self._device_sn = value
  16. @property
  17. def item_id(self):
  18. return self._item_id
  19. @item_id.setter
  20. def item_id(self, value):
  21. self._item_id = value
  22. @property
  23. def supplier_sn(self):
  24. return self._supplier_sn
  25. @supplier_sn.setter
  26. def supplier_sn(self, value):
  27. self._supplier_sn = value
  28. def to_alipay_dict(self):
  29. params = dict()
  30. if self.device_sn:
  31. if hasattr(self.device_sn, 'to_alipay_dict'):
  32. params['device_sn'] = self.device_sn.to_alipay_dict()
  33. else:
  34. params['device_sn'] = self.device_sn
  35. if self.item_id:
  36. if hasattr(self.item_id, 'to_alipay_dict'):
  37. params['item_id'] = self.item_id.to_alipay_dict()
  38. else:
  39. params['item_id'] = self.item_id
  40. if self.supplier_sn:
  41. if hasattr(self.supplier_sn, 'to_alipay_dict'):
  42. params['supplier_sn'] = self.supplier_sn.to_alipay_dict()
  43. else:
  44. params['supplier_sn'] = self.supplier_sn
  45. return params
  46. @staticmethod
  47. def from_alipay_dict(d):
  48. if not d:
  49. return None
  50. o = AlipayCommerceIotMdeviceprodDeviceQueryModel()
  51. if 'device_sn' in d:
  52. o.device_sn = d['device_sn']
  53. if 'item_id' in d:
  54. o.item_id = d['item_id']
  55. if 'supplier_sn' in d:
  56. o.supplier_sn = d['supplier_sn']
  57. return o