123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- import json
- from alipay.aop.api.constant.ParamConstants import *
- class PosDiscountDetail(object):
- def __init__(self):
- self._activity_id = None
- self._activity_type = None
- self._discount_name = None
- self._discount_type = None
- self._dish_id = None
- self._ext_info = None
- self._mrt_discount = None
- self._rt_discount = None
- self._target_user_type = None
- self._used_item_id = None
- @property
- def activity_id(self):
- return self._activity_id
- @activity_id.setter
- def activity_id(self, value):
- self._activity_id = value
- @property
- def activity_type(self):
- return self._activity_type
- @activity_type.setter
- def activity_type(self, value):
- self._activity_type = value
- @property
- def discount_name(self):
- return self._discount_name
- @discount_name.setter
- def discount_name(self, value):
- self._discount_name = value
- @property
- def discount_type(self):
- return self._discount_type
- @discount_type.setter
- def discount_type(self, value):
- self._discount_type = value
- @property
- def dish_id(self):
- return self._dish_id
- @dish_id.setter
- def dish_id(self, value):
- self._dish_id = value
- @property
- def ext_info(self):
- return self._ext_info
- @ext_info.setter
- def ext_info(self, value):
- self._ext_info = value
- @property
- def mrt_discount(self):
- return self._mrt_discount
- @mrt_discount.setter
- def mrt_discount(self, value):
- self._mrt_discount = value
- @property
- def rt_discount(self):
- return self._rt_discount
- @rt_discount.setter
- def rt_discount(self, value):
- self._rt_discount = value
- @property
- def target_user_type(self):
- return self._target_user_type
- @target_user_type.setter
- def target_user_type(self, value):
- self._target_user_type = value
- @property
- def used_item_id(self):
- return self._used_item_id
- @used_item_id.setter
- def used_item_id(self, value):
- self._used_item_id = value
- def to_alipay_dict(self):
- params = dict()
- if self.activity_id:
- if hasattr(self.activity_id, 'to_alipay_dict'):
- params['activity_id'] = self.activity_id.to_alipay_dict()
- else:
- params['activity_id'] = self.activity_id
- if self.activity_type:
- if hasattr(self.activity_type, 'to_alipay_dict'):
- params['activity_type'] = self.activity_type.to_alipay_dict()
- else:
- params['activity_type'] = self.activity_type
- if self.discount_name:
- if hasattr(self.discount_name, 'to_alipay_dict'):
- params['discount_name'] = self.discount_name.to_alipay_dict()
- else:
- params['discount_name'] = self.discount_name
- if self.discount_type:
- if hasattr(self.discount_type, 'to_alipay_dict'):
- params['discount_type'] = self.discount_type.to_alipay_dict()
- else:
- params['discount_type'] = self.discount_type
- if self.dish_id:
- if hasattr(self.dish_id, 'to_alipay_dict'):
- params['dish_id'] = self.dish_id.to_alipay_dict()
- else:
- params['dish_id'] = self.dish_id
- if self.ext_info:
- if hasattr(self.ext_info, 'to_alipay_dict'):
- params['ext_info'] = self.ext_info.to_alipay_dict()
- else:
- params['ext_info'] = self.ext_info
- if self.mrt_discount:
- if hasattr(self.mrt_discount, 'to_alipay_dict'):
- params['mrt_discount'] = self.mrt_discount.to_alipay_dict()
- else:
- params['mrt_discount'] = self.mrt_discount
- if self.rt_discount:
- if hasattr(self.rt_discount, 'to_alipay_dict'):
- params['rt_discount'] = self.rt_discount.to_alipay_dict()
- else:
- params['rt_discount'] = self.rt_discount
- if self.target_user_type:
- if hasattr(self.target_user_type, 'to_alipay_dict'):
- params['target_user_type'] = self.target_user_type.to_alipay_dict()
- else:
- params['target_user_type'] = self.target_user_type
- if self.used_item_id:
- if hasattr(self.used_item_id, 'to_alipay_dict'):
- params['used_item_id'] = self.used_item_id.to_alipay_dict()
- else:
- params['used_item_id'] = self.used_item_id
- return params
- @staticmethod
- def from_alipay_dict(d):
- if not d:
- return None
- o = PosDiscountDetail()
- if 'activity_id' in d:
- o.activity_id = d['activity_id']
- if 'activity_type' in d:
- o.activity_type = d['activity_type']
- if 'discount_name' in d:
- o.discount_name = d['discount_name']
- if 'discount_type' in d:
- o.discount_type = d['discount_type']
- if 'dish_id' in d:
- o.dish_id = d['dish_id']
- if 'ext_info' in d:
- o.ext_info = d['ext_info']
- if 'mrt_discount' in d:
- o.mrt_discount = d['mrt_discount']
- if 'rt_discount' in d:
- o.rt_discount = d['rt_discount']
- if 'target_user_type' in d:
- o.target_user_type = d['target_user_type']
- if 'used_item_id' in d:
- o.used_item_id = d['used_item_id']
- return o
|