12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- import json
- from alipay.aop.api.constant.ParamConstants import *
- class OpenItem(object):
- def __init__(self):
- self._item_id = None
- self._item_status = None
- self._store_id = None
- @property
- def item_id(self):
- return self._item_id
- @item_id.setter
- def item_id(self, value):
- self._item_id = value
- @property
- def item_status(self):
- return self._item_status
- @item_status.setter
- def item_status(self, value):
- self._item_status = value
- @property
- def store_id(self):
- return self._store_id
- @store_id.setter
- def store_id(self, value):
- self._store_id = value
- def to_alipay_dict(self):
- params = dict()
- if self.item_id:
- if hasattr(self.item_id, 'to_alipay_dict'):
- params['item_id'] = self.item_id.to_alipay_dict()
- else:
- params['item_id'] = self.item_id
- if self.item_status:
- if hasattr(self.item_status, 'to_alipay_dict'):
- params['item_status'] = self.item_status.to_alipay_dict()
- else:
- params['item_status'] = self.item_status
- if self.store_id:
- if hasattr(self.store_id, 'to_alipay_dict'):
- params['store_id'] = self.store_id.to_alipay_dict()
- else:
- params['store_id'] = self.store_id
- return params
- @staticmethod
- def from_alipay_dict(d):
- if not d:
- return None
- o = OpenItem()
- if 'item_id' in d:
- o.item_id = d['item_id']
- if 'item_status' in d:
- o.item_status = d['item_status']
- if 'store_id' in d:
- o.store_id = d['store_id']
- return o
|