#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class PageInfo(object): def __init__(self): self._current = None self._page_size = None self._total = None @property def current(self): return self._current @current.setter def current(self, value): self._current = value @property def page_size(self): return self._page_size @page_size.setter def page_size(self, value): self._page_size = value @property def total(self): return self._total @total.setter def total(self, value): self._total = value def to_alipay_dict(self): params = dict() if self.current: if hasattr(self.current, 'to_alipay_dict'): params['current'] = self.current.to_alipay_dict() else: params['current'] = self.current if self.page_size: if hasattr(self.page_size, 'to_alipay_dict'): params['page_size'] = self.page_size.to_alipay_dict() else: params['page_size'] = self.page_size if self.total: if hasattr(self.total, 'to_alipay_dict'): params['total'] = self.total.to_alipay_dict() else: params['total'] = self.total return params @staticmethod def from_alipay_dict(d): if not d: return None o = PageInfo() if 'current' in d: o.current = d['current'] if 'page_size' in d: o.page_size = d['page_size'] if 'total' in d: o.total = d['total'] return o