SmartCityCommodityInfo.py 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class SmartCityCommodityInfo(object):
  6. def __init__(self):
  7. self._affiliation = None
  8. self._auth_file = None
  9. self._test_detail = None
  10. self._test_report = None
  11. self._user_guide = None
  12. @property
  13. def affiliation(self):
  14. return self._affiliation
  15. @affiliation.setter
  16. def affiliation(self, value):
  17. self._affiliation = value
  18. @property
  19. def auth_file(self):
  20. return self._auth_file
  21. @auth_file.setter
  22. def auth_file(self, value):
  23. self._auth_file = value
  24. @property
  25. def test_detail(self):
  26. return self._test_detail
  27. @test_detail.setter
  28. def test_detail(self, value):
  29. self._test_detail = value
  30. @property
  31. def test_report(self):
  32. return self._test_report
  33. @test_report.setter
  34. def test_report(self, value):
  35. self._test_report = value
  36. @property
  37. def user_guide(self):
  38. return self._user_guide
  39. @user_guide.setter
  40. def user_guide(self, value):
  41. self._user_guide = value
  42. def to_alipay_dict(self):
  43. params = dict()
  44. if self.affiliation:
  45. if hasattr(self.affiliation, 'to_alipay_dict'):
  46. params['affiliation'] = self.affiliation.to_alipay_dict()
  47. else:
  48. params['affiliation'] = self.affiliation
  49. if self.auth_file:
  50. if hasattr(self.auth_file, 'to_alipay_dict'):
  51. params['auth_file'] = self.auth_file.to_alipay_dict()
  52. else:
  53. params['auth_file'] = self.auth_file
  54. if self.test_detail:
  55. if hasattr(self.test_detail, 'to_alipay_dict'):
  56. params['test_detail'] = self.test_detail.to_alipay_dict()
  57. else:
  58. params['test_detail'] = self.test_detail
  59. if self.test_report:
  60. if hasattr(self.test_report, 'to_alipay_dict'):
  61. params['test_report'] = self.test_report.to_alipay_dict()
  62. else:
  63. params['test_report'] = self.test_report
  64. if self.user_guide:
  65. if hasattr(self.user_guide, 'to_alipay_dict'):
  66. params['user_guide'] = self.user_guide.to_alipay_dict()
  67. else:
  68. params['user_guide'] = self.user_guide
  69. return params
  70. @staticmethod
  71. def from_alipay_dict(d):
  72. if not d:
  73. return None
  74. o = SmartCityCommodityInfo()
  75. if 'affiliation' in d:
  76. o.affiliation = d['affiliation']
  77. if 'auth_file' in d:
  78. o.auth_file = d['auth_file']
  79. if 'test_detail' in d:
  80. o.test_detail = d['test_detail']
  81. if 'test_report' in d:
  82. o.test_report = d['test_report']
  83. if 'user_guide' in d:
  84. o.user_guide = d['user_guide']
  85. return o