def to_dict(self) -> AttachmentPayload:
    result: AttachmentPayload = {'filename': self.filename, 'id': self.id, 'proxy_url': self.proxy_url, 'size': self.size, 'url': self.url, 'spoiler': self.is_spoiler()}
    if self.height:
        result['height'] = self.height
    if self.width:
        result['width'] = self.width
    if self.content_type:
        result['content_type'] = self.content_type
    if (self.description is not None):
        result['description'] = self.description
    return result
def to_dict(self) -> AttachmentPayload:
    result: AttachmentPayload = {'filename': self.filename, 'id': self.id, 'proxy_url': self.proxy_url, 'size': self.size, 'url': self.url, 'spoiler': self.is_spoiler()}
    if self.height:
        result['height'] = self.height
    if self.width:
        result['width'] = self.width
    if self.content_type:
        result['content_type'] = self.content_type
    if (self.description is not None):
        result['description'] = self.description
    return result