Skip to content

Пост

itd.models.post

NewPoll

Bases: _Poll

model_config

model_config = {'serialize_by_alias': True}

multiple

multiple: bool = Field(False, alias='multipleChoice')

options

options: list[NewPollOption]

question

question: str

NewPollOption

Bases: BaseModel

text

text: str

NewPost

Bases: _Post

attachments

attachments: list[PostAttach] = []

author

author: UserNewPost

comments

comments: list[Comment] = []

comments_count

comments_count: int = Field(0, alias='commentsCount')

content

content: str

created_at

created_at: datetime = Field(alias='createdAt')

id

id: UUID

is_liked

is_liked: bool = Field(False, alias='isLiked')

is_owner

is_owner: bool = Field(False, alias='isOwner')

is_pinned

is_pinned: bool = Field(False, alias='isPinned')

is_reposted

is_reposted: bool = Field(False, alias='isReposted')

is_viewed

is_viewed: bool = Field(False, alias='isViewed')

likes_count

likes_count: int = Field(0, alias='likesCount')

model_config

model_config = {'populate_by_name': True}

original_post

original_post: OriginalPost | None = None

poll

poll: NewPoll | None = None

reposts_count

reposts_count: int = Field(0, alias='repostsCount')

spans

spans: list[Span] = []

views_count

views_count: int = Field(0, alias='viewsCount')

wall_recipient

wall_recipient: UserPost | None = Field(None, alias='wallRecipient')

wall_recipient_id

wall_recipient_id: UUID | None = Field(None, alias='wallRecipientId')

validate_created_at

validate_created_at(v: str)

OriginalPost

Bases: _PostAuthor

author

author: UserPost

comments_count

comments_count: int = Field(0, alias='commentsCount')

content

content: str

created_at

created_at: datetime = Field(alias='createdAt')

id

id: UUID

is_deleted

is_deleted: bool = Field(False, alias='isDeleted')

likes_count

likes_count: int = Field(0, alias='likesCount')

model_config

model_config = {'populate_by_name': True}

reposts_count

reposts_count: int = Field(0, alias='repostsCount')

spans

spans: list[Span] = []

views_count

views_count: int = Field(0, alias='viewsCount')

validate_created_at

validate_created_at(v: str)

Poll

Bases: _Poll

created_at

created_at: datetime = Field(alias='createdAt')

id

id: UUID

is_voted

is_voted: bool = Field(False, alias='hasVoted')

multiple

multiple: bool = Field(False, alias='multipleChoice')

options

options: list[PollOption]

post_id

post_id: UUID = Field(alias='postId')

question

question: str

voted_option_ids

voted_option_ids: list[UUID] = Field([], alias='votedOptionIds')

votes

votes: int = Field(0, alias='totalVotes')

validate_created_at

validate_created_at(v: str)

PollData

poll

poll = NewPoll(question=question, options=[(NewPollOption(text=option)) for option in options], multipleChoice=multiple)

PollOption

Bases: NewPollOption

id

id: UUID

position

position: int = 0

text

text: str

votes

votes: int = Field(0, alias='votesCount')

Post

Bases: _Post, _PostAuthor

attachments

attachments: list[PostAttach] = []

author

author: UserPost

comments

comments: list[Comment] = []

comments_count

comments_count: int = Field(0, alias='commentsCount')

content

content: str

created_at

created_at: datetime = Field(alias='createdAt')

dominant

dominant: str | None = Field(None, alias='dominantEmoji')

edited_at

edited_at: datetime | None = Field(None, alias='editedAt')

id

id: UUID

is_liked

is_liked: bool = Field(False, alias='isLiked')

is_owner

is_owner: bool = Field(False, alias='isOwner')

is_pinned

is_pinned: bool = Field(False, alias='isPinned')

is_reposted

is_reposted: bool = Field(False, alias='isReposted')

is_viewed

is_viewed: bool = Field(False, alias='isViewed')

likes_count

likes_count: int = Field(0, alias='likesCount')

model_config

model_config = {'populate_by_name': True}

original_post

original_post: OriginalPost | None = None

poll

poll: Poll | None = None

reposts_count

reposts_count: int = Field(0, alias='repostsCount')

spans

spans: list[Span] = []

views_count

views_count: int = Field(0, alias='viewsCount')

wall_recipient

wall_recipient: UserPost | None = Field(None, alias='wallRecipient')

wall_recipient_id

wall_recipient_id: UUID | None = Field(None, alias='wallRecipientId')

validate_created_at

validate_created_at(v: str)

Span

Bases: BaseModel

length

length: int

offset

offset: int

type

type: SpanType

url

url: str | None = None