linkedapi 1.3.11__tar.gz → 1.4.1__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.
- {linkedapi-1.3.11 → linkedapi-1.4.1}/PKG-INFO +1 -1
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/__init__.py +2 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/client.py +3 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/errors.py +10 -2
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/__init__.py +2 -0
- linkedapi-1.4.1/linkedapi/operations/create_repost.py +15 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/types/__init__.py +22 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/types/company.py +11 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/types/person.py +2 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/types/post.py +77 -7
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/types/search_people.py +10 -1
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/types/search_posts.py +5 -1
- linkedapi-1.4.1/linkedapi/types/viewer_state.py +19 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/pyproject.toml +1 -1
- {linkedapi-1.3.11 → linkedapi-1.4.1}/tests/test_errors.py +5 -1
- {linkedapi-1.3.11 → linkedapi-1.4.1}/tests/test_operations.py +2 -1
- {linkedapi-1.3.11 → linkedapi-1.4.1}/.github/workflows/publish.yaml +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/.gitignore +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/LICENSE +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/README.md +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/admin/__init__.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/admin/accounts.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/admin/admin.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/admin/http_client.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/admin/limits.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/admin/subscription.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/admin/webhooks.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/config.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/core/__init__.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/core/operation.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/core/polling.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/http/__init__.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/http/base.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/http/linked_api_http_client.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/mappers/__init__.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/mappers/array.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/mappers/base.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/mappers/send_message.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/mappers/simple.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/mappers/then.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/mappers/void.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/accept_invitation.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/check_connection_status.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/comment_on_post.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/create_post.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/custom_workflow.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/fetch_company.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/fetch_job.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/fetch_person.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/fetch_post.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/ignore_invitation.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/manage_conversation.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/nv_fetch_company.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/nv_fetch_person.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/nv_manage_conversation.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/nv_search_companies.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/nv_search_people.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/nv_send_message.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/nv_sync_conversation.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/nv_sync_inbox.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/react_to_comment.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/react_to_post.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/remove_connection.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/reply_to_comment.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/retrieve_connections.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/retrieve_feed.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/retrieve_invitations.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/retrieve_pending_requests.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/retrieve_performance.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/retrieve_profile_viewers.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/retrieve_ssi.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/search_companies.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/search_jobs.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/search_people.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/search_posts.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/send_connection_request.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/send_message.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/sync_conversation.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/sync_inbox.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/sync_network.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/operations/withdraw_connection_request.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/py.typed +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/types/account.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/types/admin/__init__.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/types/admin/accounts.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/types/admin/config.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/types/admin/limits.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/types/admin/subscription.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/types/base.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/types/connection.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/types/feed.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/types/jobs.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/types/message.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/types/network.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/types/params.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/types/profile_viewers.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/types/responses.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/types/search_companies.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/types/statistics.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/types/webhooks.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/types/workflow.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/webhooks/__init__.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/linkedapi/webhooks/parse.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/tests/conftest.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/tests/test_admin.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/tests/test_direct_methods.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/tests/test_http_client.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/tests/test_mappers.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/tests/test_models.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/tests/test_polling.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/tests/test_webhooks.py +0 -0
- {linkedapi-1.3.11 → linkedapi-1.4.1}/tests/test_working_hours_contract.py +0 -0
|
@@ -33,6 +33,7 @@ from linkedapi.operations import (
|
|
|
33
33
|
CheckConnectionStatus,
|
|
34
34
|
CommentOnPost,
|
|
35
35
|
CreatePost,
|
|
36
|
+
CreateRepost,
|
|
36
37
|
CustomWorkflow,
|
|
37
38
|
FetchCompany,
|
|
38
39
|
FetchCompanyMapper,
|
|
@@ -97,6 +98,7 @@ __all__ = [
|
|
|
97
98
|
"CheckConnectionStatus",
|
|
98
99
|
"CommentOnPost",
|
|
99
100
|
"CreatePost",
|
|
101
|
+
"CreateRepost",
|
|
100
102
|
"CustomWorkflow",
|
|
101
103
|
"FetchCompany",
|
|
102
104
|
"FetchCompanyMapper",
|
|
@@ -12,6 +12,7 @@ from linkedapi.operations import (
|
|
|
12
12
|
CheckConnectionStatus,
|
|
13
13
|
CommentOnPost,
|
|
14
14
|
CreatePost,
|
|
15
|
+
CreateRepost,
|
|
15
16
|
CustomWorkflow,
|
|
16
17
|
FetchCompany,
|
|
17
18
|
FetchJob,
|
|
@@ -98,6 +99,7 @@ class LinkedApi:
|
|
|
98
99
|
self.react_to_comment = ReactToComment(self.http_client)
|
|
99
100
|
self.reply_to_comment = ReplyToComment(self.http_client)
|
|
100
101
|
self.create_post = CreatePost(self.http_client)
|
|
102
|
+
self.create_repost = CreateRepost(self.http_client)
|
|
101
103
|
self.retrieve_feed = RetrieveFeed(self.http_client)
|
|
102
104
|
self.retrieve_ssi = RetrieveSSI(self.http_client)
|
|
103
105
|
self.retrieve_performance = RetrievePerformance(self.http_client)
|
|
@@ -140,6 +142,7 @@ class LinkedApi:
|
|
|
140
142
|
self.react_to_comment,
|
|
141
143
|
self.reply_to_comment,
|
|
142
144
|
self.create_post,
|
|
145
|
+
self.create_repost,
|
|
143
146
|
self.retrieve_feed,
|
|
144
147
|
self.retrieve_ssi,
|
|
145
148
|
self.retrieve_performance,
|
|
@@ -17,14 +17,18 @@ LinkedApiActionErrorType = Literal[
|
|
|
17
17
|
"connectionNotFound",
|
|
18
18
|
"searchingNotAllowed",
|
|
19
19
|
"searchInterfaceMismatch",
|
|
20
|
-
"
|
|
20
|
+
"filterNotApplied",
|
|
21
21
|
"companyNotFound",
|
|
22
22
|
"postNotFound",
|
|
23
23
|
"jobNotFound",
|
|
24
24
|
"commentingNotAllowed",
|
|
25
25
|
"commentNotFound",
|
|
26
26
|
"replyingNotAllowed",
|
|
27
|
+
"duplicateComment",
|
|
27
28
|
"noPostingPermission",
|
|
29
|
+
"mentionNotResolved",
|
|
30
|
+
"repostNotAllowed",
|
|
31
|
+
"alreadyReposted",
|
|
28
32
|
"noSalesNavigator",
|
|
29
33
|
"conversationsNotSynced",
|
|
30
34
|
"threadNotFound",
|
|
@@ -44,14 +48,18 @@ LINKED_API_ACTION_ERROR_TYPES: tuple[str, ...] = (
|
|
|
44
48
|
"connectionNotFound",
|
|
45
49
|
"searchingNotAllowed",
|
|
46
50
|
"searchInterfaceMismatch",
|
|
47
|
-
"
|
|
51
|
+
"filterNotApplied",
|
|
48
52
|
"companyNotFound",
|
|
49
53
|
"postNotFound",
|
|
50
54
|
"jobNotFound",
|
|
51
55
|
"commentingNotAllowed",
|
|
52
56
|
"commentNotFound",
|
|
53
57
|
"replyingNotAllowed",
|
|
58
|
+
"duplicateComment",
|
|
54
59
|
"noPostingPermission",
|
|
60
|
+
"mentionNotResolved",
|
|
61
|
+
"repostNotAllowed",
|
|
62
|
+
"alreadyReposted",
|
|
55
63
|
"noSalesNavigator",
|
|
56
64
|
"conversationsNotSynced",
|
|
57
65
|
"threadNotFound",
|
|
@@ -2,6 +2,7 @@ from linkedapi.operations.accept_invitation import AcceptInvitation
|
|
|
2
2
|
from linkedapi.operations.check_connection_status import CheckConnectionStatus
|
|
3
3
|
from linkedapi.operations.comment_on_post import CommentOnPost
|
|
4
4
|
from linkedapi.operations.create_post import CreatePost
|
|
5
|
+
from linkedapi.operations.create_repost import CreateRepost
|
|
5
6
|
from linkedapi.operations.custom_workflow import CustomWorkflow
|
|
6
7
|
from linkedapi.operations.fetch_company import FetchCompany, FetchCompanyMapper
|
|
7
8
|
from linkedapi.operations.fetch_job import FetchJob, FetchJobMapper
|
|
@@ -44,6 +45,7 @@ __all__ = [
|
|
|
44
45
|
"CheckConnectionStatus",
|
|
45
46
|
"CommentOnPost",
|
|
46
47
|
"CreatePost",
|
|
48
|
+
"CreateRepost",
|
|
47
49
|
"CustomWorkflow",
|
|
48
50
|
"FetchCompany",
|
|
49
51
|
"FetchCompanyMapper",
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from linkedapi.core import Operation
|
|
4
|
+
from linkedapi.mappers import SimpleWorkflowMapper
|
|
5
|
+
from linkedapi.types import CreateRepostParams, CreateRepostResult
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class CreateRepost(Operation[CreateRepostParams, CreateRepostResult]):
|
|
9
|
+
"""Repost a LinkedIn post, either as is or with your own commentary."""
|
|
10
|
+
|
|
11
|
+
operation_name = "createRepost"
|
|
12
|
+
mapper = SimpleWorkflowMapper[CreateRepostParams, CreateRepostResult](
|
|
13
|
+
"st.createRepost",
|
|
14
|
+
result_model=CreateRepostResult,
|
|
15
|
+
)
|
|
@@ -156,23 +156,30 @@ from linkedapi.types.post import (
|
|
|
156
156
|
CommentOnPostParams,
|
|
157
157
|
CommentOnPostResult,
|
|
158
158
|
CommentResult,
|
|
159
|
+
ContentViewerState,
|
|
159
160
|
CreatePostAttachment,
|
|
160
161
|
CreatePostParams,
|
|
161
162
|
CreatePostResult,
|
|
163
|
+
CreateRepostParams,
|
|
164
|
+
CreateRepostResult,
|
|
162
165
|
FetchPostParams,
|
|
163
166
|
FetchPostResult,
|
|
164
167
|
Post,
|
|
165
168
|
PostActorType,
|
|
166
169
|
PostAuthor,
|
|
167
170
|
PostComment,
|
|
171
|
+
PostCommentAuthor,
|
|
168
172
|
PostCommenterType,
|
|
169
173
|
PostCommentsRetrievalConfig,
|
|
170
174
|
PostCommentsSort,
|
|
171
175
|
PostEngagerType,
|
|
176
|
+
PostMention,
|
|
172
177
|
PostReaction,
|
|
173
178
|
PostReactionsRetrievalConfig,
|
|
174
179
|
PostReposter,
|
|
180
|
+
PostTargetParams,
|
|
175
181
|
PostType,
|
|
182
|
+
PublishedPostResult,
|
|
176
183
|
Reaction,
|
|
177
184
|
ReactionType,
|
|
178
185
|
ReactToCommentParams,
|
|
@@ -226,6 +233,11 @@ from linkedapi.types.statistics import (
|
|
|
226
233
|
RetrievePerformanceResult,
|
|
227
234
|
RetrieveSSIResult,
|
|
228
235
|
)
|
|
236
|
+
from linkedapi.types.viewer_state import (
|
|
237
|
+
ConnectionDegree,
|
|
238
|
+
NvConnectionDegreeFilter,
|
|
239
|
+
PersonViewerState,
|
|
240
|
+
)
|
|
229
241
|
from linkedapi.types.webhooks import (
|
|
230
242
|
AccountWebhookEvent,
|
|
231
243
|
AccountWebhookEventData,
|
|
@@ -295,11 +307,13 @@ __all__ = [
|
|
|
295
307
|
"CommentOnPostResult",
|
|
296
308
|
"CommentResult",
|
|
297
309
|
"Company",
|
|
310
|
+
"ConnectionDegree",
|
|
298
311
|
"ConnectionPerson",
|
|
299
312
|
"ConnectionSession",
|
|
300
313
|
"ConnectionSessionResult",
|
|
301
314
|
"ConnectionSessionStatus",
|
|
302
315
|
"ConnectionStatus",
|
|
316
|
+
"ContentViewerState",
|
|
303
317
|
"ConversationPollRequest",
|
|
304
318
|
"ConversationPollResult",
|
|
305
319
|
"ConversationType",
|
|
@@ -309,6 +323,8 @@ __all__ = [
|
|
|
309
323
|
"CreatePostResult",
|
|
310
324
|
"CreateReconnectionSessionParams",
|
|
311
325
|
"CreateReconnectionSessionResult",
|
|
326
|
+
"CreateRepostParams",
|
|
327
|
+
"CreateRepostResult",
|
|
312
328
|
"DeleteLimitEntry",
|
|
313
329
|
"DeleteLimitsParams",
|
|
314
330
|
"DeleteWebhookParams",
|
|
@@ -374,6 +390,7 @@ __all__ = [
|
|
|
374
390
|
"NvCompanyEmployee",
|
|
375
391
|
"NvCompanyEmployeeFilter",
|
|
376
392
|
"NvCompanyEmployeeRetrievalConfig",
|
|
393
|
+
"NvConnectionDegreeFilter",
|
|
377
394
|
"NvFetchCompanyParams",
|
|
378
395
|
"NvFetchCompanyResult",
|
|
379
396
|
"NvManageConversationParams",
|
|
@@ -395,14 +412,17 @@ __all__ = [
|
|
|
395
412
|
"PersonExperience",
|
|
396
413
|
"PersonLanguage",
|
|
397
414
|
"PersonSkill",
|
|
415
|
+
"PersonViewerState",
|
|
398
416
|
"Post",
|
|
399
417
|
"PostActorType",
|
|
400
418
|
"PostAuthor",
|
|
401
419
|
"PostComment",
|
|
420
|
+
"PostCommentAuthor",
|
|
402
421
|
"PostCommenterType",
|
|
403
422
|
"PostCommentsRetrievalConfig",
|
|
404
423
|
"PostCommentsSort",
|
|
405
424
|
"PostEngagerType",
|
|
425
|
+
"PostMention",
|
|
406
426
|
"PostReaction",
|
|
407
427
|
"PostReactionsRetrievalConfig",
|
|
408
428
|
"PostReposter",
|
|
@@ -410,9 +430,11 @@ __all__ = [
|
|
|
410
430
|
"PostSearchDatePosted",
|
|
411
431
|
"PostSearchPostedBy",
|
|
412
432
|
"PostSearchSort",
|
|
433
|
+
"PostTargetParams",
|
|
413
434
|
"PostType",
|
|
414
435
|
"ProfileViewer",
|
|
415
436
|
"ProfileViewerType",
|
|
437
|
+
"PublishedPostResult",
|
|
416
438
|
"ReactToCommentParams",
|
|
417
439
|
"ReactToPostParams",
|
|
418
440
|
"Reaction",
|
|
@@ -8,6 +8,11 @@ from linkedapi.types.base import LinkedApiModel
|
|
|
8
8
|
from linkedapi.types.params import BaseActionParams, LimitParams, LimitSinceParams
|
|
9
9
|
from linkedapi.types.person import YearsOfExperience
|
|
10
10
|
from linkedapi.types.post import Post
|
|
11
|
+
from linkedapi.types.viewer_state import (
|
|
12
|
+
ConnectionDegree,
|
|
13
|
+
NvConnectionDegreeFilter,
|
|
14
|
+
PersonViewerState,
|
|
15
|
+
)
|
|
11
16
|
|
|
12
17
|
|
|
13
18
|
class StCompanyEmployee(LinkedApiModel):
|
|
@@ -17,6 +22,7 @@ class StCompanyEmployee(LinkedApiModel):
|
|
|
17
22
|
headline: str | None = None
|
|
18
23
|
location: str | None = None
|
|
19
24
|
avatar_url: str | None = None
|
|
25
|
+
viewer_state: PersonViewerState | None = None
|
|
20
26
|
|
|
21
27
|
|
|
22
28
|
class StCompanyDm(LinkedApiModel):
|
|
@@ -27,6 +33,7 @@ class StCompanyDm(LinkedApiModel):
|
|
|
27
33
|
location: str | None = None
|
|
28
34
|
avatar_url: str | None = None
|
|
29
35
|
country_code: str | None = None
|
|
36
|
+
viewer_state: PersonViewerState | None = None
|
|
30
37
|
|
|
31
38
|
|
|
32
39
|
class Company(LinkedApiModel):
|
|
@@ -69,6 +76,7 @@ class StCompanyEmployeesFilter(LinkedApiModel):
|
|
|
69
76
|
locations: list[str] | None = None
|
|
70
77
|
industries: list[str] | None = None
|
|
71
78
|
schools: list[str] | None = None
|
|
79
|
+
connection_degrees: list[ConnectionDegree] | None = None
|
|
72
80
|
|
|
73
81
|
|
|
74
82
|
class StCompanyEmployeesRetrievalConfig(LimitParams):
|
|
@@ -91,6 +99,7 @@ class NvCompanyEmployee(LinkedApiModel):
|
|
|
91
99
|
position: str | None = None
|
|
92
100
|
location: str | None = None
|
|
93
101
|
avatar_url: str | None = None
|
|
102
|
+
viewer_state: PersonViewerState | None = None
|
|
94
103
|
|
|
95
104
|
|
|
96
105
|
class NvCompanyDm(LinkedApiModel):
|
|
@@ -101,6 +110,7 @@ class NvCompanyDm(LinkedApiModel):
|
|
|
101
110
|
location: str | None = None
|
|
102
111
|
avatar_url: str | None = None
|
|
103
112
|
country_code: str | None = None
|
|
113
|
+
viewer_state: PersonViewerState | None = None
|
|
104
114
|
|
|
105
115
|
|
|
106
116
|
class NvCompany(LinkedApiModel):
|
|
@@ -138,6 +148,7 @@ class NvCompanyEmployeeFilter(LinkedApiModel):
|
|
|
138
148
|
industries: list[str] | None = None
|
|
139
149
|
schools: list[str] | None = None
|
|
140
150
|
years_of_experiences: list[YearsOfExperience] | None = None
|
|
151
|
+
connection_degrees: list[NvConnectionDegreeFilter] | None = None
|
|
141
152
|
|
|
142
153
|
|
|
143
154
|
class NvCompanyEmployeeRetrievalConfig(LimitParams):
|
|
@@ -4,6 +4,7 @@ from typing import Literal, TypeAlias
|
|
|
4
4
|
|
|
5
5
|
from linkedapi.types.params import BaseActionParams, LimitSinceParams
|
|
6
6
|
from linkedapi.types.post import Comment, Post, Reaction
|
|
7
|
+
from linkedapi.types.viewer_state import PersonViewerState
|
|
7
8
|
|
|
8
9
|
EmploymentType = Literal[
|
|
9
10
|
"fullTime",
|
|
@@ -95,6 +96,7 @@ class Person(BaseActionParams):
|
|
|
95
96
|
followers_count: int | None = None
|
|
96
97
|
about: str | None = None
|
|
97
98
|
avatar_url: str | None = None
|
|
99
|
+
viewer_state: PersonViewerState | None = None
|
|
98
100
|
experiences: list[PersonExperience] | None = None
|
|
99
101
|
education: list[PersonEducation] | None = None
|
|
100
102
|
skills: list[PersonSkill] | None = None
|
|
@@ -4,6 +4,7 @@ from typing import Literal, TypeAlias
|
|
|
4
4
|
|
|
5
5
|
from linkedapi.types.base import LinkedApiModel
|
|
6
6
|
from linkedapi.types.params import BaseActionParams, LimitParams
|
|
7
|
+
from linkedapi.types.viewer_state import PersonViewerState
|
|
7
8
|
|
|
8
9
|
PostType = Literal["original", "repost"]
|
|
9
10
|
PostActorType = Literal["person", "company"]
|
|
@@ -14,6 +15,18 @@ PostCommentsSort = Literal["mostRelevant", "mostRecent"]
|
|
|
14
15
|
AttachmentType = Literal["image", "video", "document"]
|
|
15
16
|
|
|
16
17
|
|
|
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
|
+
|
|
17
30
|
class Reaction(LinkedApiModel):
|
|
18
31
|
post_url: str | None = None
|
|
19
32
|
time: str | None = None
|
|
@@ -28,14 +41,22 @@ class Comment(LinkedApiModel):
|
|
|
28
41
|
reactions_count: int | None = None
|
|
29
42
|
|
|
30
43
|
|
|
31
|
-
class
|
|
32
|
-
|
|
44
|
+
class PostTargetParams(BaseActionParams):
|
|
45
|
+
"""A post is addressed by its URL or by its URN.
|
|
46
|
+
|
|
47
|
+
Provide one of the two; when both are given, they must refer to the same post.
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
post_url: str | None = None
|
|
51
|
+
post_urn: str | None = None
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class ReactToPostParams(PostTargetParams):
|
|
33
55
|
type: ReactionType
|
|
34
56
|
company_url: str | None = None
|
|
35
57
|
|
|
36
58
|
|
|
37
|
-
class CommentOnPostParams(
|
|
38
|
-
post_url: str
|
|
59
|
+
class CommentOnPostParams(PostTargetParams):
|
|
39
60
|
text: str
|
|
40
61
|
company_url: str | None = None
|
|
41
62
|
|
|
@@ -61,9 +82,22 @@ class ReplyToCommentParams(BaseActionParams):
|
|
|
61
82
|
ReplyToCommentResult: TypeAlias = CommentResult
|
|
62
83
|
|
|
63
84
|
|
|
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
|
+
|
|
64
96
|
class PostComment(LinkedApiModel):
|
|
65
97
|
comment_urn: str | None = None
|
|
66
98
|
comment_url: str | None = None
|
|
99
|
+
author: PostCommentAuthor | None = None
|
|
100
|
+
# Deprecated: use "author" instead of the four commenter_* fields.
|
|
67
101
|
commenter_url: str | None = None
|
|
68
102
|
commenter_name: str | None = None
|
|
69
103
|
commenter_headline: str | None = None
|
|
@@ -74,6 +108,7 @@ class PostComment(LinkedApiModel):
|
|
|
74
108
|
is_reply: bool | None = None
|
|
75
109
|
reactions_count: int | None = None
|
|
76
110
|
replies_count: int | None = None
|
|
111
|
+
viewer_state: ContentViewerState | None = None
|
|
77
112
|
|
|
78
113
|
|
|
79
114
|
class PostReaction(LinkedApiModel):
|
|
@@ -92,8 +127,11 @@ class PostAuthor(LinkedApiModel):
|
|
|
92
127
|
profile_url: str | None = None
|
|
93
128
|
headline: str | None = None
|
|
94
129
|
company_url: str | None = None
|
|
130
|
+
# Set for a person author only.
|
|
131
|
+
viewer_state: PersonViewerState | None = None
|
|
95
132
|
|
|
96
133
|
|
|
134
|
+
# A reposter carries no viewer_state: only the author's relation to your account is reported.
|
|
97
135
|
class PostReposter(LinkedApiModel):
|
|
98
136
|
type: PostActorType | None = None
|
|
99
137
|
name: str | None = None
|
|
@@ -123,6 +161,7 @@ class Post(LinkedApiModel):
|
|
|
123
161
|
reactions_count: int | None = None
|
|
124
162
|
comments_count: int | None = None
|
|
125
163
|
reposts_count: int | None = None
|
|
164
|
+
viewer_state: ContentViewerState | None = None
|
|
126
165
|
comments: list[PostComment] | None = None
|
|
127
166
|
reactions: list[PostReaction] | None = None
|
|
128
167
|
|
|
@@ -135,8 +174,7 @@ class PostCommentsRetrievalConfig(LimitParams):
|
|
|
135
174
|
PostReactionsRetrievalConfig: TypeAlias = LimitParams
|
|
136
175
|
|
|
137
176
|
|
|
138
|
-
class BaseFetchPostParams(
|
|
139
|
-
post_url: str
|
|
177
|
+
class BaseFetchPostParams(PostTargetParams):
|
|
140
178
|
retrieve_comments: bool | None = None
|
|
141
179
|
retrieve_reactions: bool | None = None
|
|
142
180
|
|
|
@@ -160,11 +198,43 @@ class CreatePostAttachment(LinkedApiModel):
|
|
|
160
198
|
name: str | None = None
|
|
161
199
|
|
|
162
200
|
|
|
201
|
+
class PostMention(LinkedApiModel):
|
|
202
|
+
"""One person or company to mention, bound to a "@[key]" placeholder in the post text.
|
|
203
|
+
|
|
204
|
+
"name" is always required because LinkedIn's composer accepts nothing but typed text. The
|
|
205
|
+
optional identifier decides which of the offered namesakes is taken; with "name" alone the pick
|
|
206
|
+
is whichever suggestion LinkedIn ranked first. Provide at most one identifier.
|
|
207
|
+
"""
|
|
208
|
+
|
|
209
|
+
key: str
|
|
210
|
+
name: str
|
|
211
|
+
urn: str | None = None
|
|
212
|
+
person_hashed_url: str | None = None
|
|
213
|
+
company_hashed_url: str | None = None
|
|
214
|
+
|
|
215
|
+
|
|
163
216
|
class CreatePostParams(BaseActionParams):
|
|
164
217
|
text: str
|
|
218
|
+
mentions: list[PostMention] | None = None
|
|
165
219
|
attachments: list[CreatePostAttachment] | None = None
|
|
166
220
|
company_url: str | None = None
|
|
167
221
|
|
|
168
222
|
|
|
169
|
-
class
|
|
223
|
+
class PublishedPostResult(LinkedApiModel):
|
|
224
|
+
"""Identifiers of a post this account has just published."""
|
|
225
|
+
|
|
170
226
|
post_url: str | None = None
|
|
227
|
+
post_urn: str | None = None
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
CreatePostResult: TypeAlias = PublishedPostResult
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
class CreateRepostParams(PostTargetParams):
|
|
234
|
+
"""Without "text" the post is reposted as is; with "text" the commentary goes above it."""
|
|
235
|
+
|
|
236
|
+
text: str | None = None
|
|
237
|
+
mentions: list[PostMention] | None = None
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
CreateRepostResult: TypeAlias = PublishedPostResult
|
|
@@ -3,6 +3,11 @@ from __future__ import annotations
|
|
|
3
3
|
from linkedapi.types.base import LinkedApiModel
|
|
4
4
|
from linkedapi.types.params import BaseActionParams, LimitParams
|
|
5
5
|
from linkedapi.types.person import YearsOfExperience
|
|
6
|
+
from linkedapi.types.viewer_state import (
|
|
7
|
+
ConnectionDegree,
|
|
8
|
+
NvConnectionDegreeFilter,
|
|
9
|
+
PersonViewerState,
|
|
10
|
+
)
|
|
6
11
|
|
|
7
12
|
|
|
8
13
|
class SearchPeopleFilter(LinkedApiModel):
|
|
@@ -14,6 +19,7 @@ class SearchPeopleFilter(LinkedApiModel):
|
|
|
14
19
|
current_companies: list[str] | None = None
|
|
15
20
|
previous_companies: list[str] | None = None
|
|
16
21
|
schools: list[str] | None = None
|
|
22
|
+
connection_degrees: list[ConnectionDegree] | None = None
|
|
17
23
|
|
|
18
24
|
|
|
19
25
|
class SearchPeopleParams(BaseActionParams, LimitParams):
|
|
@@ -29,10 +35,12 @@ class SearchPeopleResult(LinkedApiModel):
|
|
|
29
35
|
headline: str | None = None
|
|
30
36
|
location: str | None = None
|
|
31
37
|
avatar_url: str | None = None
|
|
38
|
+
viewer_state: PersonViewerState | None = None
|
|
32
39
|
|
|
33
40
|
|
|
34
41
|
class NvSearchPeopleFilter(SearchPeopleFilter):
|
|
35
|
-
|
|
42
|
+
years_of_experiences: list[YearsOfExperience] | None = None
|
|
43
|
+
connection_degrees: list[NvConnectionDegreeFilter] | None = None # type: ignore[assignment]
|
|
36
44
|
|
|
37
45
|
|
|
38
46
|
class NvSearchPeopleParams(BaseActionParams, LimitParams):
|
|
@@ -48,3 +56,4 @@ class NvSearchPeopleResult(LinkedApiModel):
|
|
|
48
56
|
position: str | None = None
|
|
49
57
|
location: str | None = None
|
|
50
58
|
avatar_url: str | None = None
|
|
59
|
+
viewer_state: PersonViewerState | None = None
|
|
@@ -4,7 +4,8 @@ from typing import Literal, TypeAlias
|
|
|
4
4
|
|
|
5
5
|
from linkedapi.types.base import LinkedApiModel
|
|
6
6
|
from linkedapi.types.params import BaseActionParams, LimitParams
|
|
7
|
-
from linkedapi.types.post import PostActorType, PostType
|
|
7
|
+
from linkedapi.types.post import ContentViewerState, PostActorType, PostType
|
|
8
|
+
from linkedapi.types.viewer_state import PersonViewerState
|
|
8
9
|
|
|
9
10
|
PostSearchSort = Literal["topMatch", "latest"]
|
|
10
11
|
PostSearchDatePosted = Literal["past24Hours", "pastWeek", "pastMonth"]
|
|
@@ -78,6 +79,8 @@ class SearchPostActor(LinkedApiModel):
|
|
|
78
79
|
profile_url: str | None = None
|
|
79
80
|
headline: str | None = None
|
|
80
81
|
company_url: str | None = None
|
|
82
|
+
# Set for a person author only; a reposter carries none.
|
|
83
|
+
viewer_state: PersonViewerState | None = None
|
|
81
84
|
|
|
82
85
|
|
|
83
86
|
class SearchPostResult(LinkedApiModel):
|
|
@@ -101,3 +104,4 @@ class SearchPostResult(LinkedApiModel):
|
|
|
101
104
|
reactions_count: int | None = None
|
|
102
105
|
comments_count: int | None = None
|
|
103
106
|
reposts_count: int | None = None
|
|
107
|
+
viewer_state: ContentViewerState | None = None
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Literal
|
|
4
|
+
|
|
5
|
+
from linkedapi.types.base import LinkedApiModel
|
|
6
|
+
|
|
7
|
+
# Your connection degree to a person, as LinkedIn shows it next to their name.
|
|
8
|
+
ConnectionDegree = Literal["1st", "2nd", "3rd+"]
|
|
9
|
+
# Sales Navigator also filters by members of the groups you belong to.
|
|
10
|
+
NvConnectionDegreeFilter = Literal["1st", "2nd", "3rd+", "groupMembers"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class PersonViewerState(LinkedApiModel):
|
|
14
|
+
"""How your account relates to a person.
|
|
15
|
+
|
|
16
|
+
"connection_degree" is None when LinkedIn shows no degree, e.g. on your own content.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
connection_degree: ConnectionDegree | None = None
|
|
@@ -46,14 +46,18 @@ def test_error_type_sets_match_node_contract() -> None:
|
|
|
46
46
|
"connectionNotFound",
|
|
47
47
|
"searchingNotAllowed",
|
|
48
48
|
"searchInterfaceMismatch",
|
|
49
|
-
"
|
|
49
|
+
"filterNotApplied",
|
|
50
50
|
"companyNotFound",
|
|
51
51
|
"postNotFound",
|
|
52
52
|
"jobNotFound",
|
|
53
53
|
"commentingNotAllowed",
|
|
54
54
|
"commentNotFound",
|
|
55
55
|
"replyingNotAllowed",
|
|
56
|
+
"duplicateComment",
|
|
56
57
|
"noPostingPermission",
|
|
58
|
+
"mentionNotResolved",
|
|
59
|
+
"repostNotAllowed",
|
|
60
|
+
"alreadyReposted",
|
|
57
61
|
"noSalesNavigator",
|
|
58
62
|
"conversationsNotSynced",
|
|
59
63
|
"threadNotFound",
|
|
@@ -64,6 +64,7 @@ def test_linked_api_exposes_all_predefined_operations() -> None:
|
|
|
64
64
|
"react_to_comment",
|
|
65
65
|
"reply_to_comment",
|
|
66
66
|
"create_post",
|
|
67
|
+
"create_repost",
|
|
67
68
|
"retrieve_ssi",
|
|
68
69
|
"retrieve_performance",
|
|
69
70
|
"retrieve_profile_viewers",
|
|
@@ -74,7 +75,7 @@ def test_linked_api_exposes_all_predefined_operations() -> None:
|
|
|
74
75
|
assert hasattr(operation, "execute")
|
|
75
76
|
assert hasattr(operation, "result")
|
|
76
77
|
assert hasattr(operation, "cancel")
|
|
77
|
-
assert len(linkedapi.operations) ==
|
|
78
|
+
assert len(linkedapi.operations) == 41
|
|
78
79
|
|
|
79
80
|
|
|
80
81
|
def test_operation_mappers_match_node_contract() -> None:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|