SignMerchantParams.py 3.1 KB

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