KbdishDictionary.py 3.7 KB

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