Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/fopost/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ class InboxPostContext(FopostModel):


class InboxItem(FopostModel):
"""A comment, mention or direct message on a connected account."""
"""A comment, mention, review or direct message on a connected account."""

id: str
workspace_id: str | None = None
Expand All @@ -690,6 +690,8 @@ class InboxItem(FopostModel):
author_handle: str | None = None
author_avatar_url: str | None = None
text: str | None = None
#: Stars on a review, 1-5. ``None`` on every other type.
rating: int | None = None
attachments: list[InboxAttachment] = []
permalink: str | None = None
post_external_id: str | None = None
Expand Down Expand Up @@ -729,6 +731,8 @@ class InboxThread(FopostModel):
last_comment_at: datetime | None = None
last_comment_text: str | None = None
last_comment_author: str | None = None
#: Stars, on a review thread. ``None`` on comments and mentions.
rating: int | None = None
post: InboxPostContext | None = None
account: InboxAccountRef | None = None

Expand Down
8 changes: 6 additions & 2 deletions src/fopost/resources/inbox.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""``client.inbox`` — comments, mentions and direct messages on connected accounts."""
"""``client.inbox`` — comments, mentions, reviews and direct messages on connected accounts."""

from __future__ import annotations

Expand Down Expand Up @@ -84,7 +84,11 @@ def threads(
page: int = 1,
per_page: int = 25,
) -> Page[InboxThread]:
"""One row per post with comments; ``kind="mentions"`` for posts we were tagged in."""
"""One row per post with comments.

``kind="mentions"`` returns the posts we were tagged in, ``kind="reviews"``
one row per review left on the business, each carrying its ``rating``.
"""
body = self._http.get(
"/inbox/posts",
{
Expand Down
Loading