CraftsmanWorkOpenModel.py 3.6 KB

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