Application Model¶
Note
The following classes come from the scurrypy.models.attachment module.
AttachmentModel
dataclass
¶
Bases: DataModel
Represents an attachment object.
id: int
instance-attribute
¶
Attachment ID.
filename: str
instance-attribute
¶
Name of the file.
title: Optional[str]
instance-attribute
¶
Title of the file.
description: Optional[str]
instance-attribute
¶
Description of the file.
content_type: Optional[str]
instance-attribute
¶
Media type of the file.
size: int
instance-attribute
¶
Size of file (in bytes).
url: str
instance-attribute
¶
Source URL of the file.
proxy_url: str
instance-attribute
¶
A proxied URL of the file.
height: Optional[int]
instance-attribute
¶
Height of file (if image).
width: Optional[int]
instance-attribute
¶
Width of file (if image).
ephemeral: Optional[bool]
instance-attribute
¶
Whether this file is ephemeral.
flags: Optional[int]
instance-attribute
¶
Attachment flags as a combined bitfield.
to_dict
¶
Recursively turns the dataclass into a dictionary and drops empty fields.
Returns:
-
dict–serialized dataclasss