KoubeiMarketingDataEnterpriseStaffinfoUploadModel.py 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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.StaffInfo import StaffInfo
  6. class KoubeiMarketingDataEnterpriseStaffinfoUploadModel(object):
  7. def __init__(self):
  8. self._batch_id = None
  9. self._enterprise_name = None
  10. self._operator_type = None
  11. self._staff_info = None
  12. @property
  13. def batch_id(self):
  14. return self._batch_id
  15. @batch_id.setter
  16. def batch_id(self, value):
  17. self._batch_id = value
  18. @property
  19. def enterprise_name(self):
  20. return self._enterprise_name
  21. @enterprise_name.setter
  22. def enterprise_name(self, value):
  23. self._enterprise_name = value
  24. @property
  25. def operator_type(self):
  26. return self._operator_type
  27. @operator_type.setter
  28. def operator_type(self, value):
  29. self._operator_type = value
  30. @property
  31. def staff_info(self):
  32. return self._staff_info
  33. @staff_info.setter
  34. def staff_info(self, value):
  35. if isinstance(value, list):
  36. self._staff_info = list()
  37. for i in value:
  38. if isinstance(i, StaffInfo):
  39. self._staff_info.append(i)
  40. else:
  41. self._staff_info.append(StaffInfo.from_alipay_dict(i))
  42. def to_alipay_dict(self):
  43. params = dict()
  44. if self.batch_id:
  45. if hasattr(self.batch_id, 'to_alipay_dict'):
  46. params['batch_id'] = self.batch_id.to_alipay_dict()
  47. else:
  48. params['batch_id'] = self.batch_id
  49. if self.enterprise_name:
  50. if hasattr(self.enterprise_name, 'to_alipay_dict'):
  51. params['enterprise_name'] = self.enterprise_name.to_alipay_dict()
  52. else:
  53. params['enterprise_name'] = self.enterprise_name
  54. if self.operator_type:
  55. if hasattr(self.operator_type, 'to_alipay_dict'):
  56. params['operator_type'] = self.operator_type.to_alipay_dict()
  57. else:
  58. params['operator_type'] = self.operator_type
  59. if self.staff_info:
  60. if isinstance(self.staff_info, list):
  61. for i in range(0, len(self.staff_info)):
  62. element = self.staff_info[i]
  63. if hasattr(element, 'to_alipay_dict'):
  64. self.staff_info[i] = element.to_alipay_dict()
  65. if hasattr(self.staff_info, 'to_alipay_dict'):
  66. params['staff_info'] = self.staff_info.to_alipay_dict()
  67. else:
  68. params['staff_info'] = self.staff_info
  69. return params
  70. @staticmethod
  71. def from_alipay_dict(d):
  72. if not d:
  73. return None
  74. o = KoubeiMarketingDataEnterpriseStaffinfoUploadModel()
  75. if 'batch_id' in d:
  76. o.batch_id = d['batch_id']
  77. if 'enterprise_name' in d:
  78. o.enterprise_name = d['enterprise_name']
  79. if 'operator_type' in d:
  80. o.operator_type = d['operator_type']
  81. if 'staff_info' in d:
  82. o.staff_info = d['staff_info']
  83. return o