AlipayCommerceOperationContentApplyModel.py 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AlipayCommerceOperationContentApplyModel(object):
  6. def __init__(self):
  7. self._booth = None
  8. self._channel = None
  9. self._city_code = None
  10. self._content_id_str = None
  11. self._ext_params = None
  12. self._out_biz_no = None
  13. self._scene = None
  14. self._touch_point = None
  15. self._user_id = None
  16. @property
  17. def booth(self):
  18. return self._booth
  19. @booth.setter
  20. def booth(self, value):
  21. self._booth = value
  22. @property
  23. def channel(self):
  24. return self._channel
  25. @channel.setter
  26. def channel(self, value):
  27. self._channel = value
  28. @property
  29. def city_code(self):
  30. return self._city_code
  31. @city_code.setter
  32. def city_code(self, value):
  33. self._city_code = value
  34. @property
  35. def content_id_str(self):
  36. return self._content_id_str
  37. @content_id_str.setter
  38. def content_id_str(self, value):
  39. self._content_id_str = value
  40. @property
  41. def ext_params(self):
  42. return self._ext_params
  43. @ext_params.setter
  44. def ext_params(self, value):
  45. self._ext_params = value
  46. @property
  47. def out_biz_no(self):
  48. return self._out_biz_no
  49. @out_biz_no.setter
  50. def out_biz_no(self, value):
  51. self._out_biz_no = value
  52. @property
  53. def scene(self):
  54. return self._scene
  55. @scene.setter
  56. def scene(self, value):
  57. self._scene = value
  58. @property
  59. def touch_point(self):
  60. return self._touch_point
  61. @touch_point.setter
  62. def touch_point(self, value):
  63. self._touch_point = value
  64. @property
  65. def user_id(self):
  66. return self._user_id
  67. @user_id.setter
  68. def user_id(self, value):
  69. self._user_id = value
  70. def to_alipay_dict(self):
  71. params = dict()
  72. if self.booth:
  73. if hasattr(self.booth, 'to_alipay_dict'):
  74. params['booth'] = self.booth.to_alipay_dict()
  75. else:
  76. params['booth'] = self.booth
  77. if self.channel:
  78. if hasattr(self.channel, 'to_alipay_dict'):
  79. params['channel'] = self.channel.to_alipay_dict()
  80. else:
  81. params['channel'] = self.channel
  82. if self.city_code:
  83. if hasattr(self.city_code, 'to_alipay_dict'):
  84. params['city_code'] = self.city_code.to_alipay_dict()
  85. else:
  86. params['city_code'] = self.city_code
  87. if self.content_id_str:
  88. if hasattr(self.content_id_str, 'to_alipay_dict'):
  89. params['content_id_str'] = self.content_id_str.to_alipay_dict()
  90. else:
  91. params['content_id_str'] = self.content_id_str
  92. if self.ext_params:
  93. if hasattr(self.ext_params, 'to_alipay_dict'):
  94. params['ext_params'] = self.ext_params.to_alipay_dict()
  95. else:
  96. params['ext_params'] = self.ext_params
  97. if self.out_biz_no:
  98. if hasattr(self.out_biz_no, 'to_alipay_dict'):
  99. params['out_biz_no'] = self.out_biz_no.to_alipay_dict()
  100. else:
  101. params['out_biz_no'] = self.out_biz_no
  102. if self.scene:
  103. if hasattr(self.scene, 'to_alipay_dict'):
  104. params['scene'] = self.scene.to_alipay_dict()
  105. else:
  106. params['scene'] = self.scene
  107. if self.touch_point:
  108. if hasattr(self.touch_point, 'to_alipay_dict'):
  109. params['touch_point'] = self.touch_point.to_alipay_dict()
  110. else:
  111. params['touch_point'] = self.touch_point
  112. if self.user_id:
  113. if hasattr(self.user_id, 'to_alipay_dict'):
  114. params['user_id'] = self.user_id.to_alipay_dict()
  115. else:
  116. params['user_id'] = self.user_id
  117. return params
  118. @staticmethod
  119. def from_alipay_dict(d):
  120. if not d:
  121. return None
  122. o = AlipayCommerceOperationContentApplyModel()
  123. if 'booth' in d:
  124. o.booth = d['booth']
  125. if 'channel' in d:
  126. o.channel = d['channel']
  127. if 'city_code' in d:
  128. o.city_code = d['city_code']
  129. if 'content_id_str' in d:
  130. o.content_id_str = d['content_id_str']
  131. if 'ext_params' in d:
  132. o.ext_params = d['ext_params']
  133. if 'out_biz_no' in d:
  134. o.out_biz_no = d['out_biz_no']
  135. if 'scene' in d:
  136. o.scene = d['scene']
  137. if 'touch_point' in d:
  138. o.touch_point = d['touch_point']
  139. if 'user_id' in d:
  140. o.user_id = d['user_id']
  141. return o