From 2727619d8712179ce8f66fdd04e3342d11b62531 Mon Sep 17 00:00:00 2001 From: Ali Hesari Date: Sun, 20 Sep 2026 02:18:06 +0200 Subject: [PATCH] feat(inbox): review items with a rating and the reviews thread kind --- src/fopost/models.py | 6 +++++- src/fopost/resources/inbox.py | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/fopost/models.py b/src/fopost/models.py index 7a0b4ec..fb2a306 100644 --- a/src/fopost/models.py +++ b/src/fopost/models.py @@ -537,7 +537,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 @@ -550,6 +550,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 @@ -589,6 +591,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 diff --git a/src/fopost/resources/inbox.py b/src/fopost/resources/inbox.py index e0a0b0a..850f5bf 100644 --- a/src/fopost/resources/inbox.py +++ b/src/fopost/resources/inbox.py @@ -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 @@ -83,7 +83,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", {