12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- import json
- from alipay.aop.api.constant.ParamConstants import *
- class SpiDetectionTask(object):
- def __init__(self):
- self._content = None
- self._data_id = None
- @property
- def content(self):
- return self._content
- @content.setter
- def content(self, value):
- self._content = value
- @property
- def data_id(self):
- return self._data_id
- @data_id.setter
- def data_id(self, value):
- self._data_id = value
- def to_alipay_dict(self):
- params = dict()
- if self.content:
- if hasattr(self.content, 'to_alipay_dict'):
- params['content'] = self.content.to_alipay_dict()
- else:
- params['content'] = self.content
- if self.data_id:
- if hasattr(self.data_id, 'to_alipay_dict'):
- params['data_id'] = self.data_id.to_alipay_dict()
- else:
- params['data_id'] = self.data_id
- return params
- @staticmethod
- def from_alipay_dict(d):
- if not d:
- return None
- o = SpiDetectionTask()
- if 'content' in d:
- o.content = d['content']
- if 'data_id' in d:
- o.data_id = d['data_id']
- return o
|