-
Notifications
You must be signed in to change notification settings - Fork 0
Models
dani edited this page Feb 23, 2024
·
11 revisions
See the client page for how to retrieve and use these models
class Post(BaseModel):
post_id: PostId
title: Optional[str]
description: Optional[str]
user: UserPortable
score: Optional[Score]
rating: Rating
parent: Optional[PostId]
privacy: Privacy
created: Optional[datetime]
updated: Optional[datetime]
filename: Optional[str]
media_type: Optional[MediaType]
size: Optional[PostSize]
blocked: boolautomatically converts post ids in int, byte, or string format to their user-friendly str format. also checks for valid values.
PostId(123)
PostId('abcd1234')
PostId(b'abc123')class PostSort(Enum):
new: str = 'new'
old: str = 'old'
top: str = 'top'
hot: str = 'hot'
best: str = 'best'
controversial: str = 'controversial'class Tag(BaseModel):
tag: str
owner: Optional[UserPortable]
group: TagGroupPortable
deprecated: bool
inherited_tags: List[str]
description: Optional[str]
count: intclass TagGroups(Dict[TagGroupPortable, List[str]]) :
passclass Set(BaseModel):
set_id: SetId
owner: UserPortable
count: int
title: Optional[str]
description: Optional[str]
privacy: UserPrivacy
created: datetime
updated: datetime
first: Optional[Post]
last: Optional[Post]automatically converts set ids in int, byte, or string format to their user-friendly str format. also checks for valid values.
SetId(123)
SetId('abc-123')
SetId(b'abcde')class PostSet(Set):
set_id: SetId
owner: UserPortable
count: int
title: Optional[str]
description: Optional[str]
privacy: UserPrivacy
created: datetime
updated: datetime
first: Optional[Post]
last: Optional[Post]
neighbors: SetNeighborsclass UserPortable(BaseModel):
name: str
handle: str
privacy: UserPrivacy
icon: Optional[PostId]
verified: Optional[Verified]
following: Optional[bool]class Score(BaseModel):
up: int
down: int
total: int
user_vote: intclass Rating(Enum):
general: str = 'general'
mature: str = 'mature'
explicit: str = 'explicit'class Privacy(Enum):
public: str = 'public'
unlisted: str = 'unlisted'
private: str = 'private'
unpublished: str = 'unpublished'
draft: str = 'draft'class MediaType(BaseModel):
file_type: str
mime_type: strclass PostSize(BaseModel):
width: int
height: intclass TagGroupPortable(Enum):
artist: str = 'artist'
subject: str = 'subject'
sponsor: str = 'sponsor'
species: str = 'species'
gender: str = 'gender'
misc: str = 'misc'class UserPrivacy(Enum):
public: str = 'public'
private: str = 'private'class SetNeighbors(BaseModel):
index: int
before: List[Optional[Post]]
after: List[Optional[Post]]class Verified(Enum):
artist: str = 'artist'
mod: str = 'mod'
admin: str = 'admin'