AlipayInsMarketingCampaignPrizeSendModel.py 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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.InsMktFactorDTO import InsMktFactorDTO
  6. class AlipayInsMarketingCampaignPrizeSendModel(object):
  7. def __init__(self):
  8. self._account_id = None
  9. self._account_type = None
  10. self._campaign_id = None
  11. self._factors = None
  12. self._out_biz_no = None
  13. self._request_id = None
  14. @property
  15. def account_id(self):
  16. return self._account_id
  17. @account_id.setter
  18. def account_id(self, value):
  19. self._account_id = value
  20. @property
  21. def account_type(self):
  22. return self._account_type
  23. @account_type.setter
  24. def account_type(self, value):
  25. self._account_type = value
  26. @property
  27. def campaign_id(self):
  28. return self._campaign_id
  29. @campaign_id.setter
  30. def campaign_id(self, value):
  31. self._campaign_id = value
  32. @property
  33. def factors(self):
  34. return self._factors
  35. @factors.setter
  36. def factors(self, value):
  37. if isinstance(value, list):
  38. self._factors = list()
  39. for i in value:
  40. if isinstance(i, InsMktFactorDTO):
  41. self._factors.append(i)
  42. else:
  43. self._factors.append(InsMktFactorDTO.from_alipay_dict(i))
  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 request_id(self):
  52. return self._request_id
  53. @request_id.setter
  54. def request_id(self, value):
  55. self._request_id = value
  56. def to_alipay_dict(self):
  57. params = dict()
  58. if self.account_id:
  59. if hasattr(self.account_id, 'to_alipay_dict'):
  60. params['account_id'] = self.account_id.to_alipay_dict()
  61. else:
  62. params['account_id'] = self.account_id
  63. if self.account_type:
  64. if hasattr(self.account_type, 'to_alipay_dict'):
  65. params['account_type'] = self.account_type.to_alipay_dict()
  66. else:
  67. params['account_type'] = self.account_type
  68. if self.campaign_id:
  69. if hasattr(self.campaign_id, 'to_alipay_dict'):
  70. params['campaign_id'] = self.campaign_id.to_alipay_dict()
  71. else:
  72. params['campaign_id'] = self.campaign_id
  73. if self.factors:
  74. if isinstance(self.factors, list):
  75. for i in range(0, len(self.factors)):
  76. element = self.factors[i]
  77. if hasattr(element, 'to_alipay_dict'):
  78. self.factors[i] = element.to_alipay_dict()
  79. if hasattr(self.factors, 'to_alipay_dict'):
  80. params['factors'] = self.factors.to_alipay_dict()
  81. else:
  82. params['factors'] = self.factors
  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.request_id:
  89. if hasattr(self.request_id, 'to_alipay_dict'):
  90. params['request_id'] = self.request_id.to_alipay_dict()
  91. else:
  92. params['request_id'] = self.request_id
  93. return params
  94. @staticmethod
  95. def from_alipay_dict(d):
  96. if not d:
  97. return None
  98. o = AlipayInsMarketingCampaignPrizeSendModel()
  99. if 'account_id' in d:
  100. o.account_id = d['account_id']
  101. if 'account_type' in d:
  102. o.account_type = d['account_type']
  103. if 'campaign_id' in d:
  104. o.campaign_id = d['campaign_id']
  105. if 'factors' in d:
  106. o.factors = d['factors']
  107. if 'out_biz_no' in d:
  108. o.out_biz_no = d['out_biz_no']
  109. if 'request_id' in d:
  110. o.request_id = d['request_id']
  111. return o