KbAdvertSpecialAdvContentModifyResponse.py 3.4 KB

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