KbAdvertChannelResponse.py 2.5 KB

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