AlipayOpenAppMessageTopicSubscribeModel.py 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AlipayOpenAppMessageTopicSubscribeModel(object):
  6. def __init__(self):
  7. self._auth_token = None
  8. self._auth_type = None
  9. self._comm_type = None
  10. self._tag = None
  11. self._topic = None
  12. @property
  13. def auth_token(self):
  14. return self._auth_token
  15. @auth_token.setter
  16. def auth_token(self, value):
  17. self._auth_token = value
  18. @property
  19. def auth_type(self):
  20. return self._auth_type
  21. @auth_type.setter
  22. def auth_type(self, value):
  23. self._auth_type = value
  24. @property
  25. def comm_type(self):
  26. return self._comm_type
  27. @comm_type.setter
  28. def comm_type(self, value):
  29. self._comm_type = value
  30. @property
  31. def tag(self):
  32. return self._tag
  33. @tag.setter
  34. def tag(self, value):
  35. self._tag = value
  36. @property
  37. def topic(self):
  38. return self._topic
  39. @topic.setter
  40. def topic(self, value):
  41. self._topic = value
  42. def to_alipay_dict(self):
  43. params = dict()
  44. if self.auth_token:
  45. if hasattr(self.auth_token, 'to_alipay_dict'):
  46. params['auth_token'] = self.auth_token.to_alipay_dict()
  47. else:
  48. params['auth_token'] = self.auth_token
  49. if self.auth_type:
  50. if hasattr(self.auth_type, 'to_alipay_dict'):
  51. params['auth_type'] = self.auth_type.to_alipay_dict()
  52. else:
  53. params['auth_type'] = self.auth_type
  54. if self.comm_type:
  55. if hasattr(self.comm_type, 'to_alipay_dict'):
  56. params['comm_type'] = self.comm_type.to_alipay_dict()
  57. else:
  58. params['comm_type'] = self.comm_type
  59. if self.tag:
  60. if hasattr(self.tag, 'to_alipay_dict'):
  61. params['tag'] = self.tag.to_alipay_dict()
  62. else:
  63. params['tag'] = self.tag
  64. if self.topic:
  65. if hasattr(self.topic, 'to_alipay_dict'):
  66. params['topic'] = self.topic.to_alipay_dict()
  67. else:
  68. params['topic'] = self.topic
  69. return params
  70. @staticmethod
  71. def from_alipay_dict(d):
  72. if not d:
  73. return None
  74. o = AlipayOpenAppMessageTopicSubscribeModel()
  75. if 'auth_token' in d:
  76. o.auth_token = d['auth_token']
  77. if 'auth_type' in d:
  78. o.auth_type = d['auth_type']
  79. if 'comm_type' in d:
  80. o.comm_type = d['comm_type']
  81. if 'tag' in d:
  82. o.tag = d['tag']
  83. if 'topic' in d:
  84. o.topic = d['topic']
  85. return o