linkedapi 1.4.3__tar.gz → 1.4.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. {linkedapi-1.4.3 → linkedapi-1.4.5}/PKG-INFO +1 -1
  2. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/__init__.py +1 -1
  3. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/client.py +35 -4
  4. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/types/__init__.py +8 -0
  5. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/types/message.py +24 -0
  6. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/types/post.py +9 -0
  7. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/types/search_posts.py +14 -4
  8. {linkedapi-1.4.3 → linkedapi-1.4.5}/pyproject.toml +1 -1
  9. {linkedapi-1.4.3 → linkedapi-1.4.5}/tests/test_direct_methods.py +54 -0
  10. {linkedapi-1.4.3 → linkedapi-1.4.5}/.github/workflows/publish.yaml +0 -0
  11. {linkedapi-1.4.3 → linkedapi-1.4.5}/.gitignore +0 -0
  12. {linkedapi-1.4.3 → linkedapi-1.4.5}/LICENSE +0 -0
  13. {linkedapi-1.4.3 → linkedapi-1.4.5}/README.md +0 -0
  14. {linkedapi-1.4.3 → linkedapi-1.4.5}/examples/verify_webhook_signature.py +0 -0
  15. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/admin/__init__.py +0 -0
  16. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/admin/accounts.py +0 -0
  17. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/admin/admin.py +0 -0
  18. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/admin/http_client.py +0 -0
  19. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/admin/limits.py +0 -0
  20. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/admin/subscription.py +0 -0
  21. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/admin/webhooks.py +0 -0
  22. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/changelog.py +0 -0
  23. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/config.py +0 -0
  24. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/core/__init__.py +0 -0
  25. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/core/operation.py +0 -0
  26. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/core/polling.py +0 -0
  27. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/errors.py +0 -0
  28. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/http/__init__.py +0 -0
  29. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/http/base.py +0 -0
  30. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/http/linked_api_http_client.py +0 -0
  31. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/mappers/__init__.py +0 -0
  32. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/mappers/array.py +0 -0
  33. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/mappers/base.py +0 -0
  34. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/mappers/send_message.py +0 -0
  35. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/mappers/simple.py +0 -0
  36. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/mappers/then.py +0 -0
  37. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/mappers/void.py +0 -0
  38. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/__init__.py +0 -0
  39. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/accept_invitation.py +0 -0
  40. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/check_connection_status.py +0 -0
  41. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/comment_on_post.py +0 -0
  42. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/create_post.py +0 -0
  43. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/create_repost.py +0 -0
  44. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/custom_workflow.py +0 -0
  45. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/fetch_company.py +0 -0
  46. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/fetch_job.py +0 -0
  47. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/fetch_person.py +0 -0
  48. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/fetch_post.py +0 -0
  49. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/ignore_invitation.py +0 -0
  50. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/manage_conversation.py +0 -0
  51. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/nv_fetch_company.py +0 -0
  52. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/nv_fetch_person.py +0 -0
  53. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/nv_manage_conversation.py +0 -0
  54. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/nv_search_companies.py +0 -0
  55. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/nv_search_people.py +0 -0
  56. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/nv_send_message.py +0 -0
  57. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/nv_sync_conversation.py +0 -0
  58. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/nv_sync_inbox.py +0 -0
  59. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/react_to_comment.py +0 -0
  60. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/react_to_post.py +0 -0
  61. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/remove_connection.py +0 -0
  62. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/reply_to_comment.py +0 -0
  63. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/retrieve_connections.py +0 -0
  64. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/retrieve_feed.py +0 -0
  65. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/retrieve_invitations.py +0 -0
  66. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/retrieve_pending_requests.py +0 -0
  67. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/retrieve_performance.py +0 -0
  68. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/retrieve_profile_viewers.py +0 -0
  69. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/retrieve_ssi.py +0 -0
  70. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/search_companies.py +0 -0
  71. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/search_jobs.py +0 -0
  72. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/search_people.py +0 -0
  73. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/search_posts.py +0 -0
  74. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/send_connection_request.py +0 -0
  75. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/send_message.py +0 -0
  76. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/sync_conversation.py +0 -0
  77. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/sync_inbox.py +0 -0
  78. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/sync_network.py +0 -0
  79. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/operations/withdraw_connection_request.py +0 -0
  80. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/py.typed +0 -0
  81. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/types/account.py +0 -0
  82. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/types/admin/__init__.py +0 -0
  83. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/types/admin/accounts.py +0 -0
  84. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/types/admin/config.py +0 -0
  85. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/types/admin/limits.py +0 -0
  86. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/types/admin/subscription.py +0 -0
  87. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/types/base.py +0 -0
  88. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/types/changelog.py +0 -0
  89. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/types/company.py +0 -0
  90. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/types/connection.py +0 -0
  91. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/types/feed.py +0 -0
  92. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/types/jobs.py +0 -0
  93. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/types/network.py +0 -0
  94. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/types/params.py +0 -0
  95. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/types/person.py +0 -0
  96. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/types/profile_viewers.py +0 -0
  97. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/types/responses.py +0 -0
  98. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/types/search_companies.py +0 -0
  99. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/types/search_people.py +0 -0
  100. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/types/statistics.py +0 -0
  101. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/types/viewer_state.py +0 -0
  102. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/types/webhooks.py +0 -0
  103. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/types/workflow.py +0 -0
  104. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/webhooks/__init__.py +0 -0
  105. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/webhooks/headers.py +0 -0
  106. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/webhooks/parse.py +0 -0
  107. {linkedapi-1.4.3 → linkedapi-1.4.5}/linkedapi/webhooks/signature.py +0 -0
  108. {linkedapi-1.4.3 → linkedapi-1.4.5}/tests/conftest.py +0 -0
  109. {linkedapi-1.4.3 → linkedapi-1.4.5}/tests/test_admin.py +0 -0
  110. {linkedapi-1.4.3 → linkedapi-1.4.5}/tests/test_admin_webhooks.py +0 -0
  111. {linkedapi-1.4.3 → linkedapi-1.4.5}/tests/test_changelog.py +0 -0
  112. {linkedapi-1.4.3 → linkedapi-1.4.5}/tests/test_errors.py +0 -0
  113. {linkedapi-1.4.3 → linkedapi-1.4.5}/tests/test_http_client.py +0 -0
  114. {linkedapi-1.4.3 → linkedapi-1.4.5}/tests/test_mappers.py +0 -0
  115. {linkedapi-1.4.3 → linkedapi-1.4.5}/tests/test_models.py +0 -0
  116. {linkedapi-1.4.3 → linkedapi-1.4.5}/tests/test_operations.py +0 -0
  117. {linkedapi-1.4.3 → linkedapi-1.4.5}/tests/test_polling.py +0 -0
  118. {linkedapi-1.4.3 → linkedapi-1.4.5}/tests/test_webhook_signature.py +0 -0
  119. {linkedapi-1.4.3 → linkedapi-1.4.5}/tests/test_webhooks.py +0 -0
  120. {linkedapi-1.4.3 → linkedapi-1.4.5}/tests/test_working_hours_contract.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: linkedapi
3
- Version: 1.4.3
3
+ Version: 1.4.5
4
4
  Summary: Official synchronous Python SDK for Linked API.
5
5
  Project-URL: Homepage, https://linkedapi.io
6
6
  Project-URL: Repository, https://github.com/Linked-API/linkedapi-python
@@ -87,7 +87,7 @@ from linkedapi.webhooks import (
87
87
  verify_webhook_signature,
88
88
  )
89
89
 
90
- __version__ = "1.4.3"
90
+ __version__ = "1.4.5"
91
91
  PredefinedOperation = Operation
92
92
 
93
93
  __all__ = [
@@ -1,6 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
- from typing import Any
3
+ from typing import Any, overload
4
4
  from urllib.parse import urlencode
5
5
 
6
6
  from linkedapi.config import LinkedApiConfig
@@ -55,6 +55,8 @@ from linkedapi.types.message import (
55
55
  ConversationPollRequest,
56
56
  ConversationPollResult,
57
57
  InboxMessage,
58
+ InboxPersonPollRequest,
59
+ InboxPersonPollResult,
58
60
  InboxPollRequest,
59
61
  )
60
62
  from linkedapi.types.network import NetworkEvent, NetworkPollRequest
@@ -161,7 +163,12 @@ class LinkedApi:
161
163
  self,
162
164
  conversations: list[ConversationPollRequest],
163
165
  ) -> MappedResponse[list[ConversationPollResult]]:
164
- """Poll previously synced standard or Sales Navigator conversations."""
166
+ """Poll previously synced standard or Sales Navigator conversations.
167
+
168
+ Deprecated: legacy, kept working for existing integrations. Use ``poll_inbox`` with
169
+ ``InboxPersonPollRequest(person_url=...)``: it returns the same history together with the
170
+ messages the inbox captured, and does not fail for people whose history was never loaded.
171
+ """
165
172
 
166
173
  try:
167
174
  response = self.http_client.post("/conversations/poll", serialize_value(conversations))
@@ -187,15 +194,39 @@ class LinkedApi:
187
194
  )
188
195
  raise
189
196
 
197
+ @overload
198
+ def poll_inbox( # type: ignore[overload-overlap]
199
+ self,
200
+ request: InboxPersonPollRequest,
201
+ ) -> MappedResponse[InboxPersonPollResult]: ...
202
+
203
+ @overload
190
204
  def poll_inbox(
191
205
  self,
192
206
  request: InboxPollRequest | None = None,
193
- ) -> MappedResponse[list[InboxMessage]]:
194
- """Read the monitored standard or Sales Navigator inbox, newest messages first."""
207
+ ) -> MappedResponse[list[InboxMessage]]: ...
208
+
209
+ def poll_inbox(
210
+ self,
211
+ request: InboxPollRequest | None = None,
212
+ ) -> MappedResponse[list[InboxMessage]] | MappedResponse[InboxPersonPollResult]:
213
+ """Read the monitored standard or Sales Navigator inbox, newest messages first.
214
+
215
+ Without ``person_url`` the data is the list of inbox messages across every conversation.
216
+ With ``person_url`` (use ``InboxPersonPollRequest``) the data is the whole known
217
+ conversation with that person: the messages the inbox captured together with the history
218
+ loaded by ``sync_conversation`` / ``nv_sync_conversation``, each message once, plus
219
+ ``threads`` with ``history_from`` and ``history_complete``.
220
+ """
195
221
 
196
222
  payload = serialize_value(request) if request is not None else {}
197
223
  response = self.http_client.post("/inbox/poll", payload)
198
224
  if response.success and response.result is not None:
225
+ if request is not None and request.person_url:
226
+ return MappedResponse(
227
+ data=InboxPersonPollResult.model_validate(response.result),
228
+ errors=[],
229
+ )
199
230
  messages = response.result.get("messages", [])
200
231
  return MappedResponse(
201
232
  data=[InboxMessage.model_validate(item) for item in messages],
@@ -112,6 +112,10 @@ from linkedapi.types.message import (
112
112
  ConversationPollResult,
113
113
  ConversationType,
114
114
  InboxMessage,
115
+ InboxPersonMessage,
116
+ InboxPersonPollRequest,
117
+ InboxPersonPollResult,
118
+ InboxPersonThread,
115
119
  InboxPollRequest,
116
120
  ManageConversationParams,
117
121
  Message,
@@ -357,6 +361,10 @@ __all__ = [
357
361
  "GetLimitsUsageParams",
358
362
  "IgnoreInvitationParams",
359
363
  "InboxMessage",
364
+ "InboxPersonMessage",
365
+ "InboxPersonPollRequest",
366
+ "InboxPersonPollResult",
367
+ "InboxPersonThread",
360
368
  "InboxPollRequest",
361
369
  "Invitation",
362
370
  "InvitationTargetParams",
@@ -2,6 +2,8 @@ from __future__ import annotations
2
2
 
3
3
  from typing import Literal
4
4
 
5
+ from pydantic import Field
6
+
5
7
  from linkedapi.types.base import LinkedApiModel
6
8
  from linkedapi.types.params import BaseActionParams
7
9
 
@@ -90,6 +92,11 @@ class InboxPollRequest(LinkedApiModel):
90
92
  since: str | None = None
91
93
  type: ConversationType | None = None
92
94
  thread_id: str | None = None
95
+ person_url: str | None = None
96
+
97
+
98
+ class InboxPersonPollRequest(InboxPollRequest):
99
+ person_url: str
93
100
 
94
101
 
95
102
  class InboxMessage(LinkedApiModel):
@@ -104,3 +111,20 @@ class InboxMessage(LinkedApiModel):
104
111
  sender: MessageSender | None = None
105
112
  text: str | None = None
106
113
  time: str | None = None
114
+
115
+
116
+ class InboxPersonMessage(InboxMessage):
117
+ inbox_message_id: str | None = None
118
+
119
+
120
+ class InboxPersonThread(LinkedApiModel):
121
+ thread_id: str | None = None
122
+ type: ConversationType | None = None
123
+ person_urn: str | None = None
124
+ history_from: str | None = None
125
+ history_complete: bool = False
126
+
127
+
128
+ class InboxPersonPollResult(LinkedApiModel):
129
+ messages: list[InboxPersonMessage] = Field(default_factory=list)
130
+ threads: list[InboxPersonThread] = Field(default_factory=list)
@@ -112,6 +112,15 @@ class PostComment(LinkedApiModel):
112
112
 
113
113
 
114
114
  class PostReaction(LinkedApiModel):
115
+ """One reaction on a post.
116
+
117
+ "actor" is whoever reacted, in the same shape a post's author has.
118
+
119
+ Deprecated: the engager_* fields are still returned; use "actor" instead.
120
+ """
121
+
122
+ actor: PostAuthor | None = None
123
+ # Deprecated: use "actor" instead of the five engager_* fields.
115
124
  engager_urn: str | None = None
116
125
  engager_url: str | None = None
117
126
  engager_name: str | None = None
@@ -16,20 +16,30 @@ PostSearchPostedBy = Literal["me", "firstConnections", "peopleYouFollow"]
16
16
  class SearchPostsPersonFilter(LinkedApiModel):
17
17
  """One person to narrow a post search by.
18
18
 
19
- "name" is always required because LinkedIn's filter panel accepts nothing but typed text. The
20
- optional identifier decides which of the offered namesakes is taken; with "name" alone the pick
21
- is whichever suggestion LinkedIn ranked first.
19
+ With "name" alone the filter may match a namesake. "id" is any identifier of the person - its
20
+ URN, or its public or hashed LinkedIn URL - and pins the filter to exactly that person; when it
21
+ cannot be applied, the action fails with "filterNotApplied" rather than filtering by somebody
22
+ else.
23
+
24
+ Deprecated: "urn" and "person_hashed_url" are still accepted; use "id" instead.
22
25
  """
23
26
 
24
27
  name: str
28
+ id: str | None = None
25
29
  urn: str | None = None
26
30
  person_hashed_url: str | None = None
27
31
 
28
32
 
29
33
  class SearchPostsCompanyFilter(LinkedApiModel):
30
- """One company to narrow a post search by. Same contract as SearchPostsPersonFilter."""
34
+ """One company to narrow a post search by. Same contract as SearchPostsPersonFilter.
35
+
36
+ "id" is the company's URN, its public or hashed LinkedIn URL, or its numeric ID.
37
+
38
+ Deprecated: "urn" and "company_hashed_url" are still accepted; use "id" instead.
39
+ """
31
40
 
32
41
  name: str
42
+ id: str | None = None
33
43
  urn: str | None = None
34
44
  company_hashed_url: str | None = None
35
45
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "linkedapi"
7
- version = "1.4.3"
7
+ version = "1.4.5"
8
8
  description = "Official synchronous Python SDK for Linked API."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -6,6 +6,7 @@ from conftest import FakeHttpClient
6
6
  from linkedapi import (
7
7
  ApiUsageParams,
8
8
  ConversationPollRequest,
9
+ InboxPersonPollRequest,
9
10
  InboxPollRequest,
10
11
  LinkedApi,
11
12
  LinkedApiActionError,
@@ -108,6 +109,59 @@ def test_poll_inbox_success(fake_http_client: FakeHttpClient) -> None:
108
109
  assert result.errors == []
109
110
 
110
111
 
112
+ def test_poll_inbox_with_person_url_returns_messages_and_threads(
113
+ fake_http_client: FakeHttpClient,
114
+ ) -> None:
115
+ linkedapi = LinkedApi(fake_http_client)
116
+ fake_http_client.queue_response(
117
+ result={
118
+ "messages": [
119
+ {
120
+ "id": "h1",
121
+ "inboxMessageId": None,
122
+ "type": "st",
123
+ "threadId": None,
124
+ "personHashedUrl": "hashed",
125
+ "sender": "them",
126
+ "text": "hi",
127
+ "time": "2026-01-01T10:00:00.000Z",
128
+ }
129
+ ],
130
+ "threads": [
131
+ {
132
+ "threadId": None,
133
+ "type": "st",
134
+ "personUrn": "urn:li:member:1",
135
+ "historyFrom": "2026-01-01T10:00:00.000Z",
136
+ "historyComplete": True,
137
+ }
138
+ ],
139
+ }
140
+ )
141
+
142
+ result = linkedapi.poll_inbox(InboxPersonPollRequest(person_url="u", since="s"))
143
+
144
+ assert fake_http_client.calls[0] == ("POST", "/inbox/poll", {"since": "s", "personUrl": "u"})
145
+ assert result.data is not None
146
+ assert result.data.messages[0].inbox_message_id is None
147
+ assert result.data.messages[0].thread_id is None
148
+ assert result.data.threads[0].history_complete is True
149
+ assert result.data.threads[0].history_from == "2026-01-01T10:00:00.000Z"
150
+
151
+
152
+ def test_poll_inbox_person_url_on_base_request_is_sent_not_dropped(
153
+ fake_http_client: FakeHttpClient,
154
+ ) -> None:
155
+ linkedapi = LinkedApi(fake_http_client)
156
+ fake_http_client.queue_response(result={"messages": [], "threads": []})
157
+
158
+ result = linkedapi.poll_inbox(InboxPollRequest(person_url="u"))
159
+
160
+ assert fake_http_client.calls[0] == ("POST", "/inbox/poll", {"personUrl": "u"})
161
+ assert result.data is not None
162
+ assert not isinstance(result.data, list)
163
+
164
+
111
165
  def test_poll_inbox_without_request_sends_empty_body(fake_http_client: FakeHttpClient) -> None:
112
166
  linkedapi = LinkedApi(fake_http_client)
113
167
  fake_http_client.queue_response(result={"messages": []})
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes