AftFinsecureRiskplusSecurityPolicyQueryModel.py 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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.EventInfo import EventInfo
  6. class AftFinsecureRiskplusSecurityPolicyQueryModel(object):
  7. def __init__(self):
  8. self._event_info = None
  9. self._product_instance_id = None
  10. @property
  11. def event_info(self):
  12. return self._event_info
  13. @event_info.setter
  14. def event_info(self, value):
  15. if isinstance(value, EventInfo):
  16. self._event_info = value
  17. else:
  18. self._event_info = EventInfo.from_alipay_dict(value)
  19. @property
  20. def product_instance_id(self):
  21. return self._product_instance_id
  22. @product_instance_id.setter
  23. def product_instance_id(self, value):
  24. self._product_instance_id = value
  25. def to_alipay_dict(self):
  26. params = dict()
  27. if self.event_info:
  28. if hasattr(self.event_info, 'to_alipay_dict'):
  29. params['event_info'] = self.event_info.to_alipay_dict()
  30. else:
  31. params['event_info'] = self.event_info
  32. if self.product_instance_id:
  33. if hasattr(self.product_instance_id, 'to_alipay_dict'):
  34. params['product_instance_id'] = self.product_instance_id.to_alipay_dict()
  35. else:
  36. params['product_instance_id'] = self.product_instance_id
  37. return params
  38. @staticmethod
  39. def from_alipay_dict(d):
  40. if not d:
  41. return None
  42. o = AftFinsecureRiskplusSecurityPolicyQueryModel()
  43. if 'event_info' in d:
  44. o.event_info = d['event_info']
  45. if 'product_instance_id' in d:
  46. o.product_instance_id = d['product_instance_id']
  47. return o