text: #!/usr/bin/env python
  # -*- coding: utf-8 -*-
  import json
  
  from alipay.aop.api.constant.ParamConstants import *
  
  
  class SaleActivityInfo(object):
  
      def __init__(self):
          self._activity_id = None
          self._amount = None
          self._quantity = None
  
      @property
      def activity_id(self):
          return self._activity_id
  
      @activity_id.setter
      def activity_id(self, value):
          self._activity_id = value
      @property
      def amount(self):
          return self._amount
  
      @amount.setter
      def amount(self, value):
          self._amount = value
      @property
      def quantity(self):
          return self._quantity
  
      @quantity.setter
      def quantity(self, value):
          self._quantity = 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.amount:
              if hasattr(self.amount, 'to_alipay_dict'):
                  params['amount'] = self.amount.to_alipay_dict()
              else:
                  params['amount'] = self.amount
          if self.quantity:
              if hasattr(self.quantity, 'to_alipay_dict'):
                  params['quantity'] = self.quantity.to_alipay_dict()
              else:
                  params['quantity'] = self.quantity
          return params
  
      @staticmethod
      def from_alipay_dict(d):
          if not d:
              return None
          o = SaleActivityInfo()
          if 'activity_id' in d:
              o.activity_id = d['activity_id']
          if 'amount' in d:
              o.amount = d['amount']
          if 'quantity' in d:
              o.quantity = d['quantity']
          return o
  
  
  