123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- import json
- from alipay.aop.api.constant.ParamConstants import *
- from alipay.aop.api.domain.Option import Option
- class LifeLabel(object):
- def __init__(self):
- self._biz = None
- self._category = None
- self._data_type = None
- self._label_code = None
- self._label_id = None
- self._label_name = None
- self._operator = None
- self._options = None
- self._type = None
- @property
- def biz(self):
- return self._biz
- @biz.setter
- def biz(self, value):
- self._biz = value
- @property
- def category(self):
- return self._category
- @category.setter
- def category(self, value):
- self._category = value
- @property
- def data_type(self):
- return self._data_type
- @data_type.setter
- def data_type(self, value):
- self._data_type = value
- @property
- def label_code(self):
- return self._label_code
- @label_code.setter
- def label_code(self, value):
- self._label_code = value
- @property
- def label_id(self):
- return self._label_id
- @label_id.setter
- def label_id(self, value):
- self._label_id = value
- @property
- def label_name(self):
- return self._label_name
- @label_name.setter
- def label_name(self, value):
- self._label_name = value
- @property
- def operator(self):
- return self._operator
- @operator.setter
- def operator(self, value):
- self._operator = value
- @property
- def options(self):
- return self._options
- @options.setter
- def options(self, value):
- if isinstance(value, list):
- self._options = list()
- for i in value:
- if isinstance(i, Option):
- self._options.append(i)
- else:
- self._options.append(Option.from_alipay_dict(i))
- @property
- def type(self):
- return self._type
- @type.setter
- def type(self, value):
- self._type = value
- def to_alipay_dict(self):
- params = dict()
- if self.biz:
- if hasattr(self.biz, 'to_alipay_dict'):
- params['biz'] = self.biz.to_alipay_dict()
- else:
- params['biz'] = self.biz
- if self.category:
- if hasattr(self.category, 'to_alipay_dict'):
- params['category'] = self.category.to_alipay_dict()
- else:
- params['category'] = self.category
- if self.data_type:
- if hasattr(self.data_type, 'to_alipay_dict'):
- params['data_type'] = self.data_type.to_alipay_dict()
- else:
- params['data_type'] = self.data_type
- if self.label_code:
- if hasattr(self.label_code, 'to_alipay_dict'):
- params['label_code'] = self.label_code.to_alipay_dict()
- else:
- params['label_code'] = self.label_code
- if self.label_id:
- if hasattr(self.label_id, 'to_alipay_dict'):
- params['label_id'] = self.label_id.to_alipay_dict()
- else:
- params['label_id'] = self.label_id
- if self.label_name:
- if hasattr(self.label_name, 'to_alipay_dict'):
- params['label_name'] = self.label_name.to_alipay_dict()
- else:
- params['label_name'] = self.label_name
- if self.operator:
- if hasattr(self.operator, 'to_alipay_dict'):
- params['operator'] = self.operator.to_alipay_dict()
- else:
- params['operator'] = self.operator
- if self.options:
- if isinstance(self.options, list):
- for i in range(0, len(self.options)):
- element = self.options[i]
- if hasattr(element, 'to_alipay_dict'):
- self.options[i] = element.to_alipay_dict()
- if hasattr(self.options, 'to_alipay_dict'):
- params['options'] = self.options.to_alipay_dict()
- else:
- params['options'] = self.options
- if self.type:
- if hasattr(self.type, 'to_alipay_dict'):
- params['type'] = self.type.to_alipay_dict()
- else:
- params['type'] = self.type
- return params
- @staticmethod
- def from_alipay_dict(d):
- if not d:
- return None
- o = LifeLabel()
- if 'biz' in d:
- o.biz = d['biz']
- if 'category' in d:
- o.category = d['category']
- if 'data_type' in d:
- o.data_type = d['data_type']
- if 'label_code' in d:
- o.label_code = d['label_code']
- if 'label_id' in d:
- o.label_id = d['label_id']
- if 'label_name' in d:
- o.label_name = d['label_name']
- if 'operator' in d:
- o.operator = d['operator']
- if 'options' in d:
- o.options = d['options']
- if 'type' in d:
- o.type = d['type']
- return o
|