44
55from linkedapi .types .base import LinkedApiModel
66from linkedapi .types .params import BaseActionParams , LimitParams
7+ from linkedapi .types .viewer_state import PersonViewerState
78
89PostType = Literal ["original" , "repost" ]
910PostActorType = Literal ["person" , "company" ]
1415AttachmentType = Literal ["image" , "video" , "document" ]
1516
1617
18+ class ContentViewerState (LinkedApiModel ):
19+ """What your account has done with a post or a comment.
20+
21+ "reaction" is None if you have not reacted or the page does not show it; comments read in the
22+ feed always report None. "is_own" is None if this cannot be told; content published as a
23+ company page you administer is False.
24+ """
25+
26+ reaction : ReactionType | None = None
27+ is_own : bool | None = None
28+
29+
1730class Reaction (LinkedApiModel ):
1831 post_url : str | None = None
1932 time : str | None = None
@@ -69,9 +82,22 @@ class ReplyToCommentParams(BaseActionParams):
6982ReplyToCommentResult : TypeAlias = CommentResult
7083
7184
85+ class PostCommentAuthor (LinkedApiModel ):
86+ """The commenter in the same actor shape a post's author has."""
87+
88+ type : PostActorType | None = None
89+ name : str | None = None
90+ profile_url : str | None = None
91+ headline : str | None = None
92+ company_url : str | None = None
93+ viewer_state : PersonViewerState | None = None
94+
95+
7296class PostComment (LinkedApiModel ):
7397 comment_urn : str | None = None
7498 comment_url : str | None = None
99+ author : PostCommentAuthor | None = None
100+ # Deprecated: use "author" instead of the four commenter_* fields.
75101 commenter_url : str | None = None
76102 commenter_name : str | None = None
77103 commenter_headline : str | None = None
@@ -82,6 +108,7 @@ class PostComment(LinkedApiModel):
82108 is_reply : bool | None = None
83109 reactions_count : int | None = None
84110 replies_count : int | None = None
111+ viewer_state : ContentViewerState | None = None
85112
86113
87114class PostReaction (LinkedApiModel ):
@@ -100,8 +127,11 @@ class PostAuthor(LinkedApiModel):
100127 profile_url : str | None = None
101128 headline : str | None = None
102129 company_url : str | None = None
130+ # Set for a person author only.
131+ viewer_state : PersonViewerState | None = None
103132
104133
134+ # A reposter carries no viewer_state: only the author's relation to your account is reported.
105135class PostReposter (LinkedApiModel ):
106136 type : PostActorType | None = None
107137 name : str | None = None
@@ -131,6 +161,7 @@ class Post(LinkedApiModel):
131161 reactions_count : int | None = None
132162 comments_count : int | None = None
133163 reposts_count : int | None = None
164+ viewer_state : ContentViewerState | None = None
134165 comments : list [PostComment ] | None = None
135166 reactions : list [PostReaction ] | None = None
136167
0 commit comments