AlipayEcoTextVoiceTransferModel.py 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AlipayEcoTextVoiceTransferModel(object):
  6. def __init__(self):
  7. self._called_number = None
  8. self._out_id = None
  9. self._tts_code = None
  10. self._tts_param = None
  11. @property
  12. def called_number(self):
  13. return self._called_number
  14. @called_number.setter
  15. def called_number(self, value):
  16. self._called_number = value
  17. @property
  18. def out_id(self):
  19. return self._out_id
  20. @out_id.setter
  21. def out_id(self, value):
  22. self._out_id = value
  23. @property
  24. def tts_code(self):
  25. return self._tts_code
  26. @tts_code.setter
  27. def tts_code(self, value):
  28. self._tts_code = value
  29. @property
  30. def tts_param(self):
  31. return self._tts_param
  32. @tts_param.setter
  33. def tts_param(self, value):
  34. self._tts_param = value
  35. def to_alipay_dict(self):
  36. params = dict()
  37. if self.called_number:
  38. if hasattr(self.called_number, 'to_alipay_dict'):
  39. params['called_number'] = self.called_number.to_alipay_dict()
  40. else:
  41. params['called_number'] = self.called_number
  42. if self.out_id:
  43. if hasattr(self.out_id, 'to_alipay_dict'):
  44. params['out_id'] = self.out_id.to_alipay_dict()
  45. else:
  46. params['out_id'] = self.out_id
  47. if self.tts_code:
  48. if hasattr(self.tts_code, 'to_alipay_dict'):
  49. params['tts_code'] = self.tts_code.to_alipay_dict()
  50. else:
  51. params['tts_code'] = self.tts_code
  52. if self.tts_param:
  53. if hasattr(self.tts_param, 'to_alipay_dict'):
  54. params['tts_param'] = self.tts_param.to_alipay_dict()
  55. else:
  56. params['tts_param'] = self.tts_param
  57. return params
  58. @staticmethod
  59. def from_alipay_dict(d):
  60. if not d:
  61. return None
  62. o = AlipayEcoTextVoiceTransferModel()
  63. if 'called_number' in d:
  64. o.called_number = d['called_number']
  65. if 'out_id' in d:
  66. o.out_id = d['out_id']
  67. if 'tts_code' in d:
  68. o.tts_code = d['tts_code']
  69. if 'tts_param' in d:
  70. o.tts_param = d['tts_param']
  71. return o