123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205 |
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- import json
- from alipay.aop.api.constant.ParamConstants import *
- class KbOrderVoucherModel(object):
- def __init__(self):
- self._expire_date = None
- self._funds_voucher_no = None
- self._item_id = None
- self._refund_reason = None
- self._refund_type = None
- self._shop_id = None
- self._status = None
- self._store_id = None
- self._ticket_effect_count = None
- self._ticket_refunded_count = None
- self._ticket_used_count = None
- self._voucher_id = None
- @property
- def expire_date(self):
- return self._expire_date
- @expire_date.setter
- def expire_date(self, value):
- self._expire_date = value
- @property
- def funds_voucher_no(self):
- return self._funds_voucher_no
- @funds_voucher_no.setter
- def funds_voucher_no(self, value):
- self._funds_voucher_no = value
- @property
- def item_id(self):
- return self._item_id
- @item_id.setter
- def item_id(self, value):
- self._item_id = value
- @property
- def refund_reason(self):
- return self._refund_reason
- @refund_reason.setter
- def refund_reason(self, value):
- self._refund_reason = value
- @property
- def refund_type(self):
- return self._refund_type
- @refund_type.setter
- def refund_type(self, value):
- self._refund_type = value
- @property
- def shop_id(self):
- return self._shop_id
- @shop_id.setter
- def shop_id(self, value):
- self._shop_id = value
- @property
- def status(self):
- return self._status
- @status.setter
- def status(self, value):
- self._status = value
- @property
- def store_id(self):
- return self._store_id
- @store_id.setter
- def store_id(self, value):
- self._store_id = value
- @property
- def ticket_effect_count(self):
- return self._ticket_effect_count
- @ticket_effect_count.setter
- def ticket_effect_count(self, value):
- self._ticket_effect_count = value
- @property
- def ticket_refunded_count(self):
- return self._ticket_refunded_count
- @ticket_refunded_count.setter
- def ticket_refunded_count(self, value):
- self._ticket_refunded_count = value
- @property
- def ticket_used_count(self):
- return self._ticket_used_count
- @ticket_used_count.setter
- def ticket_used_count(self, value):
- self._ticket_used_count = value
- @property
- def voucher_id(self):
- return self._voucher_id
- @voucher_id.setter
- def voucher_id(self, value):
- self._voucher_id = value
- def to_alipay_dict(self):
- params = dict()
- if self.expire_date:
- if hasattr(self.expire_date, 'to_alipay_dict'):
- params['expire_date'] = self.expire_date.to_alipay_dict()
- else:
- params['expire_date'] = self.expire_date
- if self.funds_voucher_no:
- if hasattr(self.funds_voucher_no, 'to_alipay_dict'):
- params['funds_voucher_no'] = self.funds_voucher_no.to_alipay_dict()
- else:
- params['funds_voucher_no'] = self.funds_voucher_no
- 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.refund_reason:
- if hasattr(self.refund_reason, 'to_alipay_dict'):
- params['refund_reason'] = self.refund_reason.to_alipay_dict()
- else:
- params['refund_reason'] = self.refund_reason
- if self.refund_type:
- if hasattr(self.refund_type, 'to_alipay_dict'):
- params['refund_type'] = self.refund_type.to_alipay_dict()
- else:
- params['refund_type'] = self.refund_type
- if self.shop_id:
- if hasattr(self.shop_id, 'to_alipay_dict'):
- params['shop_id'] = self.shop_id.to_alipay_dict()
- else:
- params['shop_id'] = self.shop_id
- if self.status:
- if hasattr(self.status, 'to_alipay_dict'):
- params['status'] = self.status.to_alipay_dict()
- else:
- params['status'] = self.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
- if self.ticket_effect_count:
- if hasattr(self.ticket_effect_count, 'to_alipay_dict'):
- params['ticket_effect_count'] = self.ticket_effect_count.to_alipay_dict()
- else:
- params['ticket_effect_count'] = self.ticket_effect_count
- if self.ticket_refunded_count:
- if hasattr(self.ticket_refunded_count, 'to_alipay_dict'):
- params['ticket_refunded_count'] = self.ticket_refunded_count.to_alipay_dict()
- else:
- params['ticket_refunded_count'] = self.ticket_refunded_count
- if self.ticket_used_count:
- if hasattr(self.ticket_used_count, 'to_alipay_dict'):
- params['ticket_used_count'] = self.ticket_used_count.to_alipay_dict()
- else:
- params['ticket_used_count'] = self.ticket_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
- return params
- @staticmethod
- def from_alipay_dict(d):
- if not d:
- return None
- o = KbOrderVoucherModel()
- if 'expire_date' in d:
- o.expire_date = d['expire_date']
- if 'funds_voucher_no' in d:
- o.funds_voucher_no = d['funds_voucher_no']
- if 'item_id' in d:
- o.item_id = d['item_id']
- if 'refund_reason' in d:
- o.refund_reason = d['refund_reason']
- if 'refund_type' in d:
- o.refund_type = d['refund_type']
- if 'shop_id' in d:
- o.shop_id = d['shop_id']
- if 'status' in d:
- o.status = d['status']
- if 'store_id' in d:
- o.store_id = d['store_id']
- if 'ticket_effect_count' in d:
- o.ticket_effect_count = d['ticket_effect_count']
- if 'ticket_refunded_count' in d:
- o.ticket_refunded_count = d['ticket_refunded_count']
- if 'ticket_used_count' in d:
- o.ticket_used_count = d['ticket_used_count']
- if 'voucher_id' in d:
- o.voucher_id = d['voucher_id']
- return o
|