AlipaySocialBaseGroupCreateModel.py 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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.GroupSetting import GroupSetting
  6. class AlipaySocialBaseGroupCreateModel(object):
  7. def __init__(self):
  8. self._biz_no = None
  9. self._biz_type = None
  10. self._group_settings = None
  11. self._master_id = None
  12. @property
  13. def biz_no(self):
  14. return self._biz_no
  15. @biz_no.setter
  16. def biz_no(self, value):
  17. self._biz_no = value
  18. @property
  19. def biz_type(self):
  20. return self._biz_type
  21. @biz_type.setter
  22. def biz_type(self, value):
  23. self._biz_type = value
  24. @property
  25. def group_settings(self):
  26. return self._group_settings
  27. @group_settings.setter
  28. def group_settings(self, value):
  29. if isinstance(value, GroupSetting):
  30. self._group_settings = value
  31. else:
  32. self._group_settings = GroupSetting.from_alipay_dict(value)
  33. @property
  34. def master_id(self):
  35. return self._master_id
  36. @master_id.setter
  37. def master_id(self, value):
  38. self._master_id = value
  39. def to_alipay_dict(self):
  40. params = dict()
  41. if self.biz_no:
  42. if hasattr(self.biz_no, 'to_alipay_dict'):
  43. params['biz_no'] = self.biz_no.to_alipay_dict()
  44. else:
  45. params['biz_no'] = self.biz_no
  46. if self.biz_type:
  47. if hasattr(self.biz_type, 'to_alipay_dict'):
  48. params['biz_type'] = self.biz_type.to_alipay_dict()
  49. else:
  50. params['biz_type'] = self.biz_type
  51. if self.group_settings:
  52. if hasattr(self.group_settings, 'to_alipay_dict'):
  53. params['group_settings'] = self.group_settings.to_alipay_dict()
  54. else:
  55. params['group_settings'] = self.group_settings
  56. if self.master_id:
  57. if hasattr(self.master_id, 'to_alipay_dict'):
  58. params['master_id'] = self.master_id.to_alipay_dict()
  59. else:
  60. params['master_id'] = self.master_id
  61. return params
  62. @staticmethod
  63. def from_alipay_dict(d):
  64. if not d:
  65. return None
  66. o = AlipaySocialBaseGroupCreateModel()
  67. if 'biz_no' in d:
  68. o.biz_no = d['biz_no']
  69. if 'biz_type' in d:
  70. o.biz_type = d['biz_type']
  71. if 'group_settings' in d:
  72. o.group_settings = d['group_settings']
  73. if 'master_id' in d:
  74. o.master_id = d['master_id']
  75. return o