123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- import json
- from alipay.aop.api.constant.ParamConstants import *
- class VoucherQueryInfo(object):
- def __init__(self):
- self._active_time = None
- self._amount = None
- self._available_amount = None
- self._expired_time = None
- self._send_time = None
- self._template_id = None
- self._used_count = None
- self._voucher_id = None
- self._voucher_status = None
- self._voucher_type = None
- @property
- def active_time(self):
- return self._active_time
- @active_time.setter
- def active_time(self, value):
- self._active_time = value
- @property
- def amount(self):
- return self._amount
- @amount.setter
- def amount(self, value):
- self._amount = value
- @property
- def available_amount(self):
- return self._available_amount
- @available_amount.setter
- def available_amount(self, value):
- self._available_amount = value
- @property
- def expired_time(self):
- return self._expired_time
- @expired_time.setter
- def expired_time(self, value):
- self._expired_time = value
- @property
- def send_time(self):
- return self._send_time
- @send_time.setter
- def send_time(self, value):
- self._send_time = value
- @property
- def template_id(self):
- return self._template_id
- @template_id.setter
- def template_id(self, value):
- self._template_id = value
- @property
- def used_count(self):
- return self._used_count
- @used_count.setter
- def used_count(self, value):
- self._used_count = value
- @property
- def voucher_id(self):
- return self._voucher_id
- @voucher_id.setter
- def voucher_id(self, value):
- self._voucher_id = value
- @property
- def voucher_status(self):
- return self._voucher_status
- @voucher_status.setter
- def voucher_status(self, value):
- self._voucher_status = value
- @property
- def voucher_type(self):
- return self._voucher_type
- @voucher_type.setter
- def voucher_type(self, value):
- self._voucher_type = value
- def to_alipay_dict(self):
- params = dict()
- if self.active_time:
- if hasattr(self.active_time, 'to_alipay_dict'):
- params['active_time'] = self.active_time.to_alipay_dict()
- else:
- params['active_time'] = self.active_time
- if self.amount:
- if hasattr(self.amount, 'to_alipay_dict'):
- params['amount'] = self.amount.to_alipay_dict()
- else:
- params['amount'] = self.amount
- if self.available_amount:
- if hasattr(self.available_amount, 'to_alipay_dict'):
- params['available_amount'] = self.available_amount.to_alipay_dict()
- else:
- params['available_amount'] = self.available_amount
- if self.expired_time:
- if hasattr(self.expired_time, 'to_alipay_dict'):
- params['expired_time'] = self.expired_time.to_alipay_dict()
- else:
- params['expired_time'] = self.expired_time
- if self.send_time:
- if hasattr(self.send_time, 'to_alipay_dict'):
- params['send_time'] = self.send_time.to_alipay_dict()
- else:
- params['send_time'] = self.send_time
- if self.template_id:
- if hasattr(self.template_id, 'to_alipay_dict'):
- params['template_id'] = self.template_id.to_alipay_dict()
- else:
- params['template_id'] = self.template_id
- if self.used_count:
- if hasattr(self.used_count, 'to_alipay_dict'):
- params['used_count'] = self.used_count.to_alipay_dict()
- else:
- params['used_count'] = self.used_count
- if self.voucher_id:
- if hasattr(self.voucher_id, 'to_alipay_dict'):
- params['voucher_id'] = self.voucher_id.to_alipay_dict()
- else:
- params['voucher_id'] = self.voucher_id
- if self.voucher_status:
- if hasattr(self.voucher_status, 'to_alipay_dict'):
- params['voucher_status'] = self.voucher_status.to_alipay_dict()
- else:
- params['voucher_status'] = self.voucher_status
- if self.voucher_type:
- if hasattr(self.voucher_type, 'to_alipay_dict'):
- params['voucher_type'] = self.voucher_type.to_alipay_dict()
- else:
- params['voucher_type'] = self.voucher_type
- return params
- @staticmethod
- def from_alipay_dict(d):
- if not d:
- return None
- o = VoucherQueryInfo()
- if 'active_time' in d:
- o.active_time = d['active_time']
- if 'amount' in d:
- o.amount = d['amount']
- if 'available_amount' in d:
- o.available_amount = d['available_amount']
- if 'expired_time' in d:
- o.expired_time = d['expired_time']
- if 'send_time' in d:
- o.send_time = d['send_time']
- if 'template_id' in d:
- o.template_id = d['template_id']
- if 'used_count' in d:
- o.used_count = d['used_count']
- if 'voucher_id' in d:
- o.voucher_id = d['voucher_id']
- if 'voucher_status' in d:
- o.voucher_status = d['voucher_status']
- if 'voucher_type' in d:
- o.voucher_type = d['voucher_type']
- return o
|