AlipayCommerceTransportMessageSendModel.py 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AlipayCommerceTransportMessageSendModel(object):
  6. def __init__(self):
  7. self._card_type = None
  8. self._merchant_biz_time = None
  9. self._notify_data = None
  10. self._notify_time = None
  11. self._notify_type = None
  12. self._user_ids = None
  13. @property
  14. def card_type(self):
  15. return self._card_type
  16. @card_type.setter
  17. def card_type(self, value):
  18. self._card_type = value
  19. @property
  20. def merchant_biz_time(self):
  21. return self._merchant_biz_time
  22. @merchant_biz_time.setter
  23. def merchant_biz_time(self, value):
  24. self._merchant_biz_time = value
  25. @property
  26. def notify_data(self):
  27. return self._notify_data
  28. @notify_data.setter
  29. def notify_data(self, value):
  30. self._notify_data = value
  31. @property
  32. def notify_time(self):
  33. return self._notify_time
  34. @notify_time.setter
  35. def notify_time(self, value):
  36. self._notify_time = value
  37. @property
  38. def notify_type(self):
  39. return self._notify_type
  40. @notify_type.setter
  41. def notify_type(self, value):
  42. self._notify_type = value
  43. @property
  44. def user_ids(self):
  45. return self._user_ids
  46. @user_ids.setter
  47. def user_ids(self, value):
  48. if isinstance(value, list):
  49. self._user_ids = list()
  50. for i in value:
  51. self._user_ids.append(i)
  52. def to_alipay_dict(self):
  53. params = dict()
  54. if self.card_type:
  55. if hasattr(self.card_type, 'to_alipay_dict'):
  56. params['card_type'] = self.card_type.to_alipay_dict()
  57. else:
  58. params['card_type'] = self.card_type
  59. if self.merchant_biz_time:
  60. if hasattr(self.merchant_biz_time, 'to_alipay_dict'):
  61. params['merchant_biz_time'] = self.merchant_biz_time.to_alipay_dict()
  62. else:
  63. params['merchant_biz_time'] = self.merchant_biz_time
  64. if self.notify_data:
  65. if hasattr(self.notify_data, 'to_alipay_dict'):
  66. params['notify_data'] = self.notify_data.to_alipay_dict()
  67. else:
  68. params['notify_data'] = self.notify_data
  69. if self.notify_time:
  70. if hasattr(self.notify_time, 'to_alipay_dict'):
  71. params['notify_time'] = self.notify_time.to_alipay_dict()
  72. else:
  73. params['notify_time'] = self.notify_time
  74. if self.notify_type:
  75. if hasattr(self.notify_type, 'to_alipay_dict'):
  76. params['notify_type'] = self.notify_type.to_alipay_dict()
  77. else:
  78. params['notify_type'] = self.notify_type
  79. if self.user_ids:
  80. if isinstance(self.user_ids, list):
  81. for i in range(0, len(self.user_ids)):
  82. element = self.user_ids[i]
  83. if hasattr(element, 'to_alipay_dict'):
  84. self.user_ids[i] = element.to_alipay_dict()
  85. if hasattr(self.user_ids, 'to_alipay_dict'):
  86. params['user_ids'] = self.user_ids.to_alipay_dict()
  87. else:
  88. params['user_ids'] = self.user_ids
  89. return params
  90. @staticmethod
  91. def from_alipay_dict(d):
  92. if not d:
  93. return None
  94. o = AlipayCommerceTransportMessageSendModel()
  95. if 'card_type' in d:
  96. o.card_type = d['card_type']
  97. if 'merchant_biz_time' in d:
  98. o.merchant_biz_time = d['merchant_biz_time']
  99. if 'notify_data' in d:
  100. o.notify_data = d['notify_data']
  101. if 'notify_time' in d:
  102. o.notify_time = d['notify_time']
  103. if 'notify_type' in d:
  104. o.notify_type = d['notify_type']
  105. if 'user_ids' in d:
  106. o.user_ids = d['user_ids']
  107. return o