AlipayUserAccountDeviceInfoQueryModel.py 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AlipayUserAccountDeviceInfoQueryModel(object):
  6. def __init__(self):
  7. self._device_ids = None
  8. self._device_type = None
  9. self._encrypt_type = None
  10. self._extra_info = None
  11. self._request_from = None
  12. @property
  13. def device_ids(self):
  14. return self._device_ids
  15. @device_ids.setter
  16. def device_ids(self, value):
  17. if isinstance(value, list):
  18. self._device_ids = list()
  19. for i in value:
  20. self._device_ids.append(i)
  21. @property
  22. def device_type(self):
  23. return self._device_type
  24. @device_type.setter
  25. def device_type(self, value):
  26. self._device_type = value
  27. @property
  28. def encrypt_type(self):
  29. return self._encrypt_type
  30. @encrypt_type.setter
  31. def encrypt_type(self, value):
  32. self._encrypt_type = value
  33. @property
  34. def extra_info(self):
  35. return self._extra_info
  36. @extra_info.setter
  37. def extra_info(self, value):
  38. self._extra_info = value
  39. @property
  40. def request_from(self):
  41. return self._request_from
  42. @request_from.setter
  43. def request_from(self, value):
  44. self._request_from = value
  45. def to_alipay_dict(self):
  46. params = dict()
  47. if self.device_ids:
  48. if isinstance(self.device_ids, list):
  49. for i in range(0, len(self.device_ids)):
  50. element = self.device_ids[i]
  51. if hasattr(element, 'to_alipay_dict'):
  52. self.device_ids[i] = element.to_alipay_dict()
  53. if hasattr(self.device_ids, 'to_alipay_dict'):
  54. params['device_ids'] = self.device_ids.to_alipay_dict()
  55. else:
  56. params['device_ids'] = self.device_ids
  57. if self.device_type:
  58. if hasattr(self.device_type, 'to_alipay_dict'):
  59. params['device_type'] = self.device_type.to_alipay_dict()
  60. else:
  61. params['device_type'] = self.device_type
  62. if self.encrypt_type:
  63. if hasattr(self.encrypt_type, 'to_alipay_dict'):
  64. params['encrypt_type'] = self.encrypt_type.to_alipay_dict()
  65. else:
  66. params['encrypt_type'] = self.encrypt_type
  67. if self.extra_info:
  68. if hasattr(self.extra_info, 'to_alipay_dict'):
  69. params['extra_info'] = self.extra_info.to_alipay_dict()
  70. else:
  71. params['extra_info'] = self.extra_info
  72. if self.request_from:
  73. if hasattr(self.request_from, 'to_alipay_dict'):
  74. params['request_from'] = self.request_from.to_alipay_dict()
  75. else:
  76. params['request_from'] = self.request_from
  77. return params
  78. @staticmethod
  79. def from_alipay_dict(d):
  80. if not d:
  81. return None
  82. o = AlipayUserAccountDeviceInfoQueryModel()
  83. if 'device_ids' in d:
  84. o.device_ids = d['device_ids']
  85. if 'device_type' in d:
  86. o.device_type = d['device_type']
  87. if 'encrypt_type' in d:
  88. o.encrypt_type = d['encrypt_type']
  89. if 'extra_info' in d:
  90. o.extra_info = d['extra_info']
  91. if 'request_from' in d:
  92. o.request_from = d['request_from']
  93. return o