AlipayInsSceneCouponSendModel.py 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AlipayInsSceneCouponSendModel(object):
  6. def __init__(self):
  7. self._channel_user_id = None
  8. self._channel_user_source = None
  9. self._dimension_id = None
  10. self._dimension_type = None
  11. self._market_type = None
  12. self._out_biz_no = None
  13. self._service_scenario = None
  14. @property
  15. def channel_user_id(self):
  16. return self._channel_user_id
  17. @channel_user_id.setter
  18. def channel_user_id(self, value):
  19. self._channel_user_id = value
  20. @property
  21. def channel_user_source(self):
  22. return self._channel_user_source
  23. @channel_user_source.setter
  24. def channel_user_source(self, value):
  25. self._channel_user_source = value
  26. @property
  27. def dimension_id(self):
  28. return self._dimension_id
  29. @dimension_id.setter
  30. def dimension_id(self, value):
  31. self._dimension_id = value
  32. @property
  33. def dimension_type(self):
  34. return self._dimension_type
  35. @dimension_type.setter
  36. def dimension_type(self, value):
  37. self._dimension_type = value
  38. @property
  39. def market_type(self):
  40. return self._market_type
  41. @market_type.setter
  42. def market_type(self, value):
  43. self._market_type = value
  44. @property
  45. def out_biz_no(self):
  46. return self._out_biz_no
  47. @out_biz_no.setter
  48. def out_biz_no(self, value):
  49. self._out_biz_no = value
  50. @property
  51. def service_scenario(self):
  52. return self._service_scenario
  53. @service_scenario.setter
  54. def service_scenario(self, value):
  55. self._service_scenario = value
  56. def to_alipay_dict(self):
  57. params = dict()
  58. if self.channel_user_id:
  59. if hasattr(self.channel_user_id, 'to_alipay_dict'):
  60. params['channel_user_id'] = self.channel_user_id.to_alipay_dict()
  61. else:
  62. params['channel_user_id'] = self.channel_user_id
  63. if self.channel_user_source:
  64. if hasattr(self.channel_user_source, 'to_alipay_dict'):
  65. params['channel_user_source'] = self.channel_user_source.to_alipay_dict()
  66. else:
  67. params['channel_user_source'] = self.channel_user_source
  68. if self.dimension_id:
  69. if hasattr(self.dimension_id, 'to_alipay_dict'):
  70. params['dimension_id'] = self.dimension_id.to_alipay_dict()
  71. else:
  72. params['dimension_id'] = self.dimension_id
  73. if self.dimension_type:
  74. if hasattr(self.dimension_type, 'to_alipay_dict'):
  75. params['dimension_type'] = self.dimension_type.to_alipay_dict()
  76. else:
  77. params['dimension_type'] = self.dimension_type
  78. if self.market_type:
  79. if hasattr(self.market_type, 'to_alipay_dict'):
  80. params['market_type'] = self.market_type.to_alipay_dict()
  81. else:
  82. params['market_type'] = self.market_type
  83. if self.out_biz_no:
  84. if hasattr(self.out_biz_no, 'to_alipay_dict'):
  85. params['out_biz_no'] = self.out_biz_no.to_alipay_dict()
  86. else:
  87. params['out_biz_no'] = self.out_biz_no
  88. if self.service_scenario:
  89. if hasattr(self.service_scenario, 'to_alipay_dict'):
  90. params['service_scenario'] = self.service_scenario.to_alipay_dict()
  91. else:
  92. params['service_scenario'] = self.service_scenario
  93. return params
  94. @staticmethod
  95. def from_alipay_dict(d):
  96. if not d:
  97. return None
  98. o = AlipayInsSceneCouponSendModel()
  99. if 'channel_user_id' in d:
  100. o.channel_user_id = d['channel_user_id']
  101. if 'channel_user_source' in d:
  102. o.channel_user_source = d['channel_user_source']
  103. if 'dimension_id' in d:
  104. o.dimension_id = d['dimension_id']
  105. if 'dimension_type' in d:
  106. o.dimension_type = d['dimension_type']
  107. if 'market_type' in d:
  108. o.market_type = d['market_type']
  109. if 'out_biz_no' in d:
  110. o.out_biz_no = d['out_biz_no']
  111. if 'service_scenario' in d:
  112. o.service_scenario = d['service_scenario']
  113. return o