TemplateColumnInfoDTO.py 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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.MoreInfoDTO import MoreInfoDTO
  6. class TemplateColumnInfoDTO(object):
  7. def __init__(self):
  8. self._code = None
  9. self._group_title = None
  10. self._icon_id = None
  11. self._more_info = None
  12. self._operate_type = None
  13. self._tag = None
  14. self._title = None
  15. self._value = None
  16. @property
  17. def code(self):
  18. return self._code
  19. @code.setter
  20. def code(self, value):
  21. self._code = value
  22. @property
  23. def group_title(self):
  24. return self._group_title
  25. @group_title.setter
  26. def group_title(self, value):
  27. self._group_title = value
  28. @property
  29. def icon_id(self):
  30. return self._icon_id
  31. @icon_id.setter
  32. def icon_id(self, value):
  33. self._icon_id = value
  34. @property
  35. def more_info(self):
  36. return self._more_info
  37. @more_info.setter
  38. def more_info(self, value):
  39. if isinstance(value, MoreInfoDTO):
  40. self._more_info = value
  41. else:
  42. self._more_info = MoreInfoDTO.from_alipay_dict(value)
  43. @property
  44. def operate_type(self):
  45. return self._operate_type
  46. @operate_type.setter
  47. def operate_type(self, value):
  48. self._operate_type = value
  49. @property
  50. def tag(self):
  51. return self._tag
  52. @tag.setter
  53. def tag(self, value):
  54. self._tag = value
  55. @property
  56. def title(self):
  57. return self._title
  58. @title.setter
  59. def title(self, value):
  60. self._title = value
  61. @property
  62. def value(self):
  63. return self._value
  64. @value.setter
  65. def value(self, value):
  66. self._value = value
  67. def to_alipay_dict(self):
  68. params = dict()
  69. if self.code:
  70. if hasattr(self.code, 'to_alipay_dict'):
  71. params['code'] = self.code.to_alipay_dict()
  72. else:
  73. params['code'] = self.code
  74. if self.group_title:
  75. if hasattr(self.group_title, 'to_alipay_dict'):
  76. params['group_title'] = self.group_title.to_alipay_dict()
  77. else:
  78. params['group_title'] = self.group_title
  79. if self.icon_id:
  80. if hasattr(self.icon_id, 'to_alipay_dict'):
  81. params['icon_id'] = self.icon_id.to_alipay_dict()
  82. else:
  83. params['icon_id'] = self.icon_id
  84. if self.more_info:
  85. if hasattr(self.more_info, 'to_alipay_dict'):
  86. params['more_info'] = self.more_info.to_alipay_dict()
  87. else:
  88. params['more_info'] = self.more_info
  89. if self.operate_type:
  90. if hasattr(self.operate_type, 'to_alipay_dict'):
  91. params['operate_type'] = self.operate_type.to_alipay_dict()
  92. else:
  93. params['operate_type'] = self.operate_type
  94. if self.tag:
  95. if hasattr(self.tag, 'to_alipay_dict'):
  96. params['tag'] = self.tag.to_alipay_dict()
  97. else:
  98. params['tag'] = self.tag
  99. if self.title:
  100. if hasattr(self.title, 'to_alipay_dict'):
  101. params['title'] = self.title.to_alipay_dict()
  102. else:
  103. params['title'] = self.title
  104. if self.value:
  105. if hasattr(self.value, 'to_alipay_dict'):
  106. params['value'] = self.value.to_alipay_dict()
  107. else:
  108. params['value'] = self.value
  109. return params
  110. @staticmethod
  111. def from_alipay_dict(d):
  112. if not d:
  113. return None
  114. o = TemplateColumnInfoDTO()
  115. if 'code' in d:
  116. o.code = d['code']
  117. if 'group_title' in d:
  118. o.group_title = d['group_title']
  119. if 'icon_id' in d:
  120. o.icon_id = d['icon_id']
  121. if 'more_info' in d:
  122. o.more_info = d['more_info']
  123. if 'operate_type' in d:
  124. o.operate_type = d['operate_type']
  125. if 'tag' in d:
  126. o.tag = d['tag']
  127. if 'title' in d:
  128. o.title = d['title']
  129. if 'value' in d:
  130. o.value = d['value']
  131. return o