#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class AttachmentDetail(object): def __init__(self): self._code = None self._file_name = None self._file_url = None @property def code(self): return self._code @code.setter def code(self, value): self._code = value @property def file_name(self): return self._file_name @file_name.setter def file_name(self, value): self._file_name = value @property def file_url(self): return self._file_url @file_url.setter def file_url(self, value): self._file_url = value def to_alipay_dict(self): params = dict() if self.code: if hasattr(self.code, 'to_alipay_dict'): params['code'] = self.code.to_alipay_dict() else: params['code'] = self.code if self.file_name: if hasattr(self.file_name, 'to_alipay_dict'): params['file_name'] = self.file_name.to_alipay_dict() else: params['file_name'] = self.file_name if self.file_url: if hasattr(self.file_url, 'to_alipay_dict'): params['file_url'] = self.file_url.to_alipay_dict() else: params['file_url'] = self.file_url return params @staticmethod def from_alipay_dict(d): if not d: return None o = AttachmentDetail() if 'code' in d: o.code = d['code'] if 'file_name' in d: o.file_name = d['file_name'] if 'file_url' in d: o.file_url = d['file_url'] return o