linkedapi 1.3.7__tar.gz → 1.3.10__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.7 → linkedapi-1.3.10}/PKG-INFO +2 -2
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/__init__.py +3 -1
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/client.py +3 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/errors.py +2 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/__init__.py +2 -0
- linkedapi-1.3.10/linkedapi/operations/retrieve_profile_viewers.py +15 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/types/__init__.py +14 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/types/company.py +10 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/types/connection.py +7 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/types/jobs.py +50 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/types/message.py +5 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/types/network.py +1 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/types/person.py +1 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/types/post.py +3 -0
- linkedapi-1.3.10/linkedapi/types/profile_viewers.py +82 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/types/search_companies.py +2 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/types/search_people.py +2 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/types/webhooks.py +5 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/pyproject.toml +1 -1
- {linkedapi-1.3.7 → linkedapi-1.3.10}/tests/test_errors.py +1 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/tests/test_operations.py +2 -1
- {linkedapi-1.3.7 → linkedapi-1.3.10}/.github/workflows/publish.yaml +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/.gitignore +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/LICENSE +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/README.md +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/admin/__init__.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/admin/accounts.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/admin/admin.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/admin/http_client.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/admin/limits.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/admin/subscription.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/admin/webhooks.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/config.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/core/__init__.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/core/operation.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/core/polling.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/http/__init__.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/http/base.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/http/linked_api_http_client.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/mappers/__init__.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/mappers/array.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/mappers/base.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/mappers/send_message.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/mappers/simple.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/mappers/then.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/mappers/void.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/accept_invitation.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/check_connection_status.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/comment_on_post.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/create_post.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/custom_workflow.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/fetch_company.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/fetch_job.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/fetch_person.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/fetch_post.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/ignore_invitation.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/manage_conversation.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/nv_fetch_company.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/nv_fetch_person.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/nv_manage_conversation.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/nv_search_companies.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/nv_search_people.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/nv_send_message.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/nv_sync_conversation.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/nv_sync_inbox.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/react_to_comment.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/react_to_post.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/remove_connection.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/reply_to_comment.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/retrieve_connections.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/retrieve_feed.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/retrieve_invitations.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/retrieve_pending_requests.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/retrieve_performance.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/retrieve_ssi.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/search_companies.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/search_jobs.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/search_people.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/send_connection_request.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/send_message.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/sync_conversation.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/sync_inbox.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/sync_network.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/operations/withdraw_connection_request.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/py.typed +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/types/account.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/types/admin/__init__.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/types/admin/accounts.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/types/admin/config.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/types/admin/limits.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/types/admin/subscription.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/types/base.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/types/feed.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/types/params.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/types/responses.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/types/statistics.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/types/workflow.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/webhooks/__init__.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/linkedapi/webhooks/parse.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/tests/conftest.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/tests/test_admin.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/tests/test_direct_methods.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/tests/test_http_client.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/tests/test_mappers.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/tests/test_models.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/tests/test_polling.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/tests/test_webhooks.py +0 -0
- {linkedapi-1.3.7 → linkedapi-1.3.10}/tests/test_working_hours_contract.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: linkedapi
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.10
|
|
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
|
|
@@ -63,6 +63,7 @@ from linkedapi.operations import (
|
|
|
63
63
|
RetrieveInvitations,
|
|
64
64
|
RetrievePendingRequests,
|
|
65
65
|
RetrievePerformance,
|
|
66
|
+
RetrieveProfileViewers,
|
|
66
67
|
RetrieveSSI,
|
|
67
68
|
SearchCompanies,
|
|
68
69
|
SearchJobs,
|
|
@@ -78,7 +79,7 @@ from linkedapi.types import * # noqa: F403
|
|
|
78
79
|
from linkedapi.types import __all__ as _types_all
|
|
79
80
|
from linkedapi.webhooks import parse_webhook_event
|
|
80
81
|
|
|
81
|
-
__version__ = "1.3.
|
|
82
|
+
__version__ = "1.3.9"
|
|
82
83
|
PredefinedOperation = Operation
|
|
83
84
|
|
|
84
85
|
__all__ = [
|
|
@@ -140,6 +141,7 @@ __all__ = [
|
|
|
140
141
|
"RetrieveFeed",
|
|
141
142
|
"RetrievePendingRequests",
|
|
142
143
|
"RetrievePerformance",
|
|
144
|
+
"RetrieveProfileViewers",
|
|
143
145
|
"RetrieveSSI",
|
|
144
146
|
"SearchCompanies",
|
|
145
147
|
"SearchJobs",
|
|
@@ -36,6 +36,7 @@ from linkedapi.operations import (
|
|
|
36
36
|
RetrieveInvitations,
|
|
37
37
|
RetrievePendingRequests,
|
|
38
38
|
RetrievePerformance,
|
|
39
|
+
RetrieveProfileViewers,
|
|
39
40
|
RetrieveSSI,
|
|
40
41
|
SearchCompanies,
|
|
41
42
|
SearchJobs,
|
|
@@ -98,6 +99,7 @@ class LinkedApi:
|
|
|
98
99
|
self.retrieve_feed = RetrieveFeed(self.http_client)
|
|
99
100
|
self.retrieve_ssi = RetrieveSSI(self.http_client)
|
|
100
101
|
self.retrieve_performance = RetrievePerformance(self.http_client)
|
|
102
|
+
self.retrieve_profile_viewers = RetrieveProfileViewers(self.http_client)
|
|
101
103
|
self.nv_send_message = NvSendMessage(self.http_client)
|
|
102
104
|
self.nv_sync_conversation = NvSyncConversation(self.http_client)
|
|
103
105
|
self.nv_sync_inbox = NvSyncInbox(self.http_client)
|
|
@@ -138,6 +140,7 @@ class LinkedApi:
|
|
|
138
140
|
self.retrieve_feed,
|
|
139
141
|
self.retrieve_ssi,
|
|
140
142
|
self.retrieve_performance,
|
|
143
|
+
self.retrieve_profile_viewers,
|
|
141
144
|
self.nv_send_message,
|
|
142
145
|
self.nv_sync_conversation,
|
|
143
146
|
self.nv_sync_inbox,
|
|
@@ -16,6 +16,7 @@ LinkedApiActionErrorType = Literal[
|
|
|
16
16
|
"retrievingNotAllowed",
|
|
17
17
|
"connectionNotFound",
|
|
18
18
|
"searchingNotAllowed",
|
|
19
|
+
"searchInterfaceMismatch",
|
|
19
20
|
"companyNotFound",
|
|
20
21
|
"postNotFound",
|
|
21
22
|
"jobNotFound",
|
|
@@ -41,6 +42,7 @@ LINKED_API_ACTION_ERROR_TYPES: tuple[str, ...] = (
|
|
|
41
42
|
"retrievingNotAllowed",
|
|
42
43
|
"connectionNotFound",
|
|
43
44
|
"searchingNotAllowed",
|
|
45
|
+
"searchInterfaceMismatch",
|
|
44
46
|
"companyNotFound",
|
|
45
47
|
"postNotFound",
|
|
46
48
|
"jobNotFound",
|
|
@@ -26,6 +26,7 @@ from linkedapi.operations.retrieve_feed import RetrieveFeed
|
|
|
26
26
|
from linkedapi.operations.retrieve_invitations import RetrieveInvitations
|
|
27
27
|
from linkedapi.operations.retrieve_pending_requests import RetrievePendingRequests
|
|
28
28
|
from linkedapi.operations.retrieve_performance import RetrievePerformance
|
|
29
|
+
from linkedapi.operations.retrieve_profile_viewers import RetrieveProfileViewers
|
|
29
30
|
from linkedapi.operations.retrieve_ssi import RetrieveSSI
|
|
30
31
|
from linkedapi.operations.search_companies import SearchCompanies
|
|
31
32
|
from linkedapi.operations.search_jobs import SearchJobs
|
|
@@ -72,6 +73,7 @@ __all__ = [
|
|
|
72
73
|
"RetrieveInvitations",
|
|
73
74
|
"RetrievePendingRequests",
|
|
74
75
|
"RetrievePerformance",
|
|
76
|
+
"RetrieveProfileViewers",
|
|
75
77
|
"RetrieveSSI",
|
|
76
78
|
"SearchCompanies",
|
|
77
79
|
"SearchJobs",
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from linkedapi.core import Operation
|
|
4
|
+
from linkedapi.mappers import ArrayWorkflowMapper
|
|
5
|
+
from linkedapi.types import ProfileViewer, RetrieveProfileViewersParams
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class RetrieveProfileViewers(Operation[RetrieveProfileViewersParams, list[ProfileViewer]]):
|
|
9
|
+
"""Retrieve the viewers visible on the current account's LinkedIn profile."""
|
|
10
|
+
|
|
11
|
+
operation_name = "retrieveProfileViewers"
|
|
12
|
+
mapper = ArrayWorkflowMapper[RetrieveProfileViewersParams, ProfileViewer](
|
|
13
|
+
"st.retrieveProfileViewers",
|
|
14
|
+
ProfileViewer,
|
|
15
|
+
)
|
|
@@ -96,12 +96,15 @@ from linkedapi.types.jobs import (
|
|
|
96
96
|
JobDatePosted,
|
|
97
97
|
JobEmploymentType,
|
|
98
98
|
JobExperienceLevel,
|
|
99
|
+
JobPreferenceEmploymentType,
|
|
100
|
+
JobPreferenceExperienceLevel,
|
|
99
101
|
JobSalary,
|
|
100
102
|
JobWorkplaceType,
|
|
101
103
|
SalaryPeriod,
|
|
102
104
|
SearchJobResult,
|
|
103
105
|
SearchJobsFilter,
|
|
104
106
|
SearchJobsParams,
|
|
107
|
+
SearchJobsPreferences,
|
|
105
108
|
)
|
|
106
109
|
from linkedapi.types.message import (
|
|
107
110
|
ConversationPollRequest,
|
|
@@ -177,6 +180,11 @@ from linkedapi.types.post import (
|
|
|
177
180
|
ReplyToCommentParams,
|
|
178
181
|
ReplyToCommentResult,
|
|
179
182
|
)
|
|
183
|
+
from linkedapi.types.profile_viewers import (
|
|
184
|
+
ProfileViewer,
|
|
185
|
+
ProfileViewerType,
|
|
186
|
+
RetrieveProfileViewersParams,
|
|
187
|
+
)
|
|
180
188
|
from linkedapi.types.responses import LinkedApiRequestError, LinkedApiResponse
|
|
181
189
|
from linkedapi.types.search_companies import (
|
|
182
190
|
AnnualRevenueFilter,
|
|
@@ -315,6 +323,8 @@ __all__ = [
|
|
|
315
323
|
"JobDatePosted",
|
|
316
324
|
"JobEmploymentType",
|
|
317
325
|
"JobExperienceLevel",
|
|
326
|
+
"JobPreferenceEmploymentType",
|
|
327
|
+
"JobPreferenceExperienceLevel",
|
|
318
328
|
"JobSalary",
|
|
319
329
|
"JobWorkplaceType",
|
|
320
330
|
"LanguageProficiency",
|
|
@@ -383,6 +393,8 @@ __all__ = [
|
|
|
383
393
|
"PostReactionsRetrievalConfig",
|
|
384
394
|
"PostReposter",
|
|
385
395
|
"PostType",
|
|
396
|
+
"ProfileViewer",
|
|
397
|
+
"ProfileViewerType",
|
|
386
398
|
"ReactToCommentParams",
|
|
387
399
|
"ReactToPostParams",
|
|
388
400
|
"Reaction",
|
|
@@ -402,6 +414,7 @@ __all__ = [
|
|
|
402
414
|
"RetrieveFeedParams",
|
|
403
415
|
"RetrievePendingRequestsResult",
|
|
404
416
|
"RetrievePerformanceResult",
|
|
417
|
+
"RetrieveProfileViewersParams",
|
|
405
418
|
"RetrieveSSIResult",
|
|
406
419
|
"SalaryPeriod",
|
|
407
420
|
"SearchCompaniesFilter",
|
|
@@ -411,6 +424,7 @@ __all__ = [
|
|
|
411
424
|
"SearchJobResult",
|
|
412
425
|
"SearchJobsFilter",
|
|
413
426
|
"SearchJobsParams",
|
|
427
|
+
"SearchJobsPreferences",
|
|
414
428
|
"SearchPeopleFilter",
|
|
415
429
|
"SearchPeopleParams",
|
|
416
430
|
"SearchPeopleResult",
|
|
@@ -12,21 +12,26 @@ from linkedapi.types.post import Post
|
|
|
12
12
|
|
|
13
13
|
class StCompanyEmployee(LinkedApiModel):
|
|
14
14
|
name: str | None = None
|
|
15
|
+
urn: str | None = None
|
|
15
16
|
public_url: str | None = None
|
|
16
17
|
headline: str | None = None
|
|
17
18
|
location: str | None = None
|
|
19
|
+
avatar_url: str | None = None
|
|
18
20
|
|
|
19
21
|
|
|
20
22
|
class StCompanyDm(LinkedApiModel):
|
|
21
23
|
name: str | None = None
|
|
24
|
+
urn: str | None = None
|
|
22
25
|
public_url: str | None = None
|
|
23
26
|
headline: str | None = None
|
|
24
27
|
location: str | None = None
|
|
28
|
+
avatar_url: str | None = None
|
|
25
29
|
country_code: str | None = None
|
|
26
30
|
|
|
27
31
|
|
|
28
32
|
class Company(LinkedApiModel):
|
|
29
33
|
name: str | None = None
|
|
34
|
+
urn: str | None = None
|
|
30
35
|
public_url: str | None = None
|
|
31
36
|
description: str | None = None
|
|
32
37
|
location: str | None = None
|
|
@@ -81,21 +86,26 @@ FetchCompanyResult: TypeAlias = Company
|
|
|
81
86
|
|
|
82
87
|
class NvCompanyEmployee(LinkedApiModel):
|
|
83
88
|
name: str | None = None
|
|
89
|
+
urn: str | None = None
|
|
84
90
|
hashed_url: str | None = None
|
|
85
91
|
position: str | None = None
|
|
86
92
|
location: str | None = None
|
|
93
|
+
avatar_url: str | None = None
|
|
87
94
|
|
|
88
95
|
|
|
89
96
|
class NvCompanyDm(LinkedApiModel):
|
|
90
97
|
name: str | None = None
|
|
98
|
+
urn: str | None = None
|
|
91
99
|
hashed_url: str | None = None
|
|
92
100
|
position: str | None = None
|
|
93
101
|
location: str | None = None
|
|
102
|
+
avatar_url: str | None = None
|
|
94
103
|
country_code: str | None = None
|
|
95
104
|
|
|
96
105
|
|
|
97
106
|
class NvCompany(LinkedApiModel):
|
|
98
107
|
name: str | None = None
|
|
108
|
+
urn: str | None = None
|
|
99
109
|
public_url: str | None = None
|
|
100
110
|
description: str | None = None
|
|
101
111
|
location: str | None = None
|
|
@@ -40,6 +40,7 @@ class WithdrawConnectionRequestParams(BaseActionParams):
|
|
|
40
40
|
|
|
41
41
|
class RetrievePendingRequestsResult(LinkedApiModel):
|
|
42
42
|
name: str | None = None
|
|
43
|
+
urn: str | None = None
|
|
43
44
|
public_url: str | None = None
|
|
44
45
|
headline: str | None = None
|
|
45
46
|
sent_time: str | None = None
|
|
@@ -78,6 +79,7 @@ class IgnoreInvitationParams(InvitationTargetParams):
|
|
|
78
79
|
class Invitation(LinkedApiModel):
|
|
79
80
|
invitation_type: InvitationType
|
|
80
81
|
name: str
|
|
82
|
+
urn: str | None = None
|
|
81
83
|
public_url: str
|
|
82
84
|
headline: str | None = None
|
|
83
85
|
note: str | None = None
|
|
@@ -146,10 +148,12 @@ class RetrieveConnectionsParams(LimitParams):
|
|
|
146
148
|
|
|
147
149
|
class RetrieveConnectionsResult(LinkedApiModel):
|
|
148
150
|
name: str | None = None
|
|
151
|
+
urn: str | None = None
|
|
149
152
|
public_url: str | None = None
|
|
150
153
|
headline: str | None = None
|
|
151
154
|
location: str | None = None
|
|
152
155
|
connected_at: str | None = None
|
|
156
|
+
avatar_url: str | None = None
|
|
153
157
|
|
|
154
158
|
|
|
155
159
|
class RemoveConnectionParams(BaseActionParams):
|
|
@@ -162,6 +166,7 @@ class NvOpenPersonPageParams(BaseActionParams):
|
|
|
162
166
|
|
|
163
167
|
class NvOpenPersonPageResult(LinkedApiModel):
|
|
164
168
|
name: str | None = None
|
|
169
|
+
urn: str | None = None
|
|
165
170
|
public_url: str | None = None
|
|
166
171
|
hashed_url: str | None = None
|
|
167
172
|
headline: str | None = None
|
|
@@ -169,4 +174,6 @@ class NvOpenPersonPageResult(LinkedApiModel):
|
|
|
169
174
|
country_code: str | None = None
|
|
170
175
|
position: str | None = None
|
|
171
176
|
company_name: str | None = None
|
|
177
|
+
company_urn: str | None = None
|
|
172
178
|
company_hashed_url: str | None = None
|
|
179
|
+
avatar_url: str | None = None
|
|
@@ -24,6 +24,24 @@ JobEmploymentType = Literal[
|
|
|
24
24
|
"other",
|
|
25
25
|
]
|
|
26
26
|
JobWorkplaceType = Literal["onSite", "remote", "hybrid"]
|
|
27
|
+
# Experience levels of LinkedIn's AI-powered jobs search. Not a subset of JobExperienceLevel:
|
|
28
|
+
# "senior" corresponds to "midSeniorLevel", "manager" has no classic equivalent, and "internship"
|
|
29
|
+
# and "associate" are absent here.
|
|
30
|
+
JobPreferenceExperienceLevel = Literal[
|
|
31
|
+
"entryLevel",
|
|
32
|
+
"senior",
|
|
33
|
+
"manager",
|
|
34
|
+
"director",
|
|
35
|
+
"executive",
|
|
36
|
+
]
|
|
37
|
+
# Same names as JobEmploymentType, minus "temporary" and "other".
|
|
38
|
+
JobPreferenceEmploymentType = Literal[
|
|
39
|
+
"fullTime",
|
|
40
|
+
"partTime",
|
|
41
|
+
"contract",
|
|
42
|
+
"internship",
|
|
43
|
+
"volunteer",
|
|
44
|
+
]
|
|
27
45
|
SalaryPeriod = Literal["yearly", "monthly", "hourly"]
|
|
28
46
|
JobCurrency = Literal[
|
|
29
47
|
"usd",
|
|
@@ -74,6 +92,12 @@ class JobSalary(LinkedApiModel):
|
|
|
74
92
|
|
|
75
93
|
|
|
76
94
|
class SearchJobsFilter(LinkedApiModel):
|
|
95
|
+
"""Filtering criteria for the classic LinkedIn jobs search.
|
|
96
|
+
|
|
97
|
+
Every specified field is applied, or the action fails.
|
|
98
|
+
"""
|
|
99
|
+
|
|
100
|
+
# Deprecated: use the top-level "location" of SearchJobsParams instead.
|
|
77
101
|
location: str | None = None
|
|
78
102
|
date_posted: JobDatePosted | None = None
|
|
79
103
|
experience_levels: list[JobExperienceLevel] | None = None
|
|
@@ -89,14 +113,38 @@ class SearchJobsFilter(LinkedApiModel):
|
|
|
89
113
|
fair_chance_employer: bool | None = None
|
|
90
114
|
|
|
91
115
|
|
|
116
|
+
class SearchJobsPreferences(LinkedApiModel):
|
|
117
|
+
"""Filtering criteria for LinkedIn's AI-powered jobs search.
|
|
118
|
+
|
|
119
|
+
LinkedIn decides which of them it offers for a given search, and the ones it does not offer are
|
|
120
|
+
skipped instead of failing the action.
|
|
121
|
+
"""
|
|
122
|
+
|
|
123
|
+
date_posted: JobDatePosted | None = None
|
|
124
|
+
experience_levels: list[JobPreferenceExperienceLevel] | None = None
|
|
125
|
+
employment_types: list[JobPreferenceEmploymentType] | None = None
|
|
126
|
+
companies: list[str] | None = None
|
|
127
|
+
remote: bool | None = None
|
|
128
|
+
easy_apply: bool | None = None
|
|
129
|
+
under_10_applicants: bool | None = None
|
|
130
|
+
in_your_network: bool | None = None
|
|
131
|
+
keywords: list[str] | None = None
|
|
132
|
+
|
|
133
|
+
|
|
92
134
|
class SearchJobsParams(BaseActionParams, LimitParams):
|
|
93
135
|
term: str | None = None
|
|
136
|
+
location: str | None = None
|
|
137
|
+
allow_similar_results: bool | None = None
|
|
138
|
+
# "filter" and "preferences" are mutually exclusive: "filter" targets the classic LinkedIn jobs
|
|
139
|
+
# search, "preferences" the AI-powered one.
|
|
94
140
|
filter: SearchJobsFilter | None = None
|
|
141
|
+
preferences: SearchJobsPreferences | None = None
|
|
95
142
|
custom_search_url: str | None = None
|
|
96
143
|
|
|
97
144
|
|
|
98
145
|
class SearchJobResult(LinkedApiModel):
|
|
99
146
|
job_id: str | None = None
|
|
147
|
+
urn: str | None = None
|
|
100
148
|
job_url: str | None = None
|
|
101
149
|
title: str | None = None
|
|
102
150
|
company_name: str | None = None
|
|
@@ -105,6 +153,7 @@ class SearchJobResult(LinkedApiModel):
|
|
|
105
153
|
salary: JobSalary | None = None
|
|
106
154
|
easy_apply: bool | None = None
|
|
107
155
|
is_promoted: bool | None = None
|
|
156
|
+
is_similar_match: bool | None = None
|
|
108
157
|
|
|
109
158
|
|
|
110
159
|
class FetchJobParams(BaseActionParams):
|
|
@@ -113,6 +162,7 @@ class FetchJobParams(BaseActionParams):
|
|
|
113
162
|
|
|
114
163
|
class Job(LinkedApiModel):
|
|
115
164
|
job_id: str | None = None
|
|
165
|
+
urn: str | None = None
|
|
116
166
|
job_url: str | None = None
|
|
117
167
|
title: str | None = None
|
|
118
168
|
company_name: str | None = None
|
|
@@ -78,6 +78,7 @@ class Message(LinkedApiModel):
|
|
|
78
78
|
|
|
79
79
|
|
|
80
80
|
class ConversationPollResult(LinkedApiModel):
|
|
81
|
+
person_urn: str | None = None
|
|
81
82
|
person_url: str | None = None
|
|
82
83
|
type: ConversationType | None = None
|
|
83
84
|
messages: list[Message] | None = None
|
|
@@ -95,6 +96,10 @@ class InboxMessage(LinkedApiModel):
|
|
|
95
96
|
id: str | None = None
|
|
96
97
|
type: ConversationType | None = None
|
|
97
98
|
thread_id: str | None = None
|
|
99
|
+
person_urn: str | None = None
|
|
100
|
+
person_hashed_url: str | None = None
|
|
101
|
+
person_public_url: str | None = None
|
|
102
|
+
# Deprecated: use person_hashed_url. Still returned by the API for compatibility.
|
|
98
103
|
person_url: str | None = None
|
|
99
104
|
sender: MessageSender | None = None
|
|
100
105
|
text: str | None = None
|
|
@@ -77,6 +77,7 @@ class PostComment(LinkedApiModel):
|
|
|
77
77
|
|
|
78
78
|
|
|
79
79
|
class PostReaction(LinkedApiModel):
|
|
80
|
+
engager_urn: str | None = None
|
|
80
81
|
engager_url: str | None = None
|
|
81
82
|
engager_name: str | None = None
|
|
82
83
|
engager_headline: str | None = None
|
|
@@ -87,6 +88,7 @@ class PostReaction(LinkedApiModel):
|
|
|
87
88
|
class PostAuthor(LinkedApiModel):
|
|
88
89
|
type: PostActorType | None = None
|
|
89
90
|
name: str | None = None
|
|
91
|
+
urn: str | None = None
|
|
90
92
|
profile_url: str | None = None
|
|
91
93
|
headline: str | None = None
|
|
92
94
|
company_url: str | None = None
|
|
@@ -95,6 +97,7 @@ class PostAuthor(LinkedApiModel):
|
|
|
95
97
|
class PostReposter(LinkedApiModel):
|
|
96
98
|
type: PostActorType | None = None
|
|
97
99
|
name: str | None = None
|
|
100
|
+
urn: str | None = None
|
|
98
101
|
profile_url: str | None = None
|
|
99
102
|
headline: str | None = None
|
|
100
103
|
company_url: str | None = None
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Literal
|
|
4
|
+
|
|
5
|
+
from pydantic import Field, model_validator
|
|
6
|
+
|
|
7
|
+
from linkedapi.types.base import LinkedApiModel
|
|
8
|
+
from linkedapi.types.params import BaseActionParams
|
|
9
|
+
|
|
10
|
+
ProfileViewerType = Literal["identified", "anonymous"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class RetrieveProfileViewersParams(BaseActionParams):
|
|
14
|
+
limit: int | None = Field(default=None, ge=1, le=300)
|
|
15
|
+
since: str | None = None
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ProfileViewer(LinkedApiModel):
|
|
19
|
+
viewer_type: ProfileViewerType
|
|
20
|
+
viewed_at: str | None
|
|
21
|
+
viewed_ago: str | None
|
|
22
|
+
name: str | None = None
|
|
23
|
+
public_url: str | None = None
|
|
24
|
+
urn: str | None = None
|
|
25
|
+
headline: str | None = None
|
|
26
|
+
connection_degree: Literal[1, 2, 3] | None = None
|
|
27
|
+
avatar_url: str | None = None
|
|
28
|
+
description: str | None = None
|
|
29
|
+
search_url: str | None = None
|
|
30
|
+
|
|
31
|
+
@model_validator(mode="after")
|
|
32
|
+
def validate_type_fields(self) -> ProfileViewer:
|
|
33
|
+
type_fields = {
|
|
34
|
+
"name",
|
|
35
|
+
"public_url",
|
|
36
|
+
"urn",
|
|
37
|
+
"headline",
|
|
38
|
+
"connection_degree",
|
|
39
|
+
"avatar_url",
|
|
40
|
+
"description",
|
|
41
|
+
"search_url",
|
|
42
|
+
}
|
|
43
|
+
required_fields = {
|
|
44
|
+
"identified": {
|
|
45
|
+
"name",
|
|
46
|
+
"public_url",
|
|
47
|
+
"urn",
|
|
48
|
+
"headline",
|
|
49
|
+
"connection_degree",
|
|
50
|
+
"avatar_url",
|
|
51
|
+
},
|
|
52
|
+
"anonymous": {"description", "search_url"},
|
|
53
|
+
}[self.viewer_type]
|
|
54
|
+
missing_fields = required_fields - self.model_fields_set
|
|
55
|
+
if missing_fields:
|
|
56
|
+
msg = (
|
|
57
|
+
f"{self.viewer_type} profile viewer is missing required fields: "
|
|
58
|
+
f"{', '.join(sorted(missing_fields))}"
|
|
59
|
+
)
|
|
60
|
+
raise ValueError(msg)
|
|
61
|
+
|
|
62
|
+
unexpected_fields = (self.model_fields_set & type_fields) - required_fields
|
|
63
|
+
if unexpected_fields:
|
|
64
|
+
msg = (
|
|
65
|
+
f"{self.viewer_type} profile viewer contains fields for another type: "
|
|
66
|
+
f"{', '.join(sorted(unexpected_fields))}"
|
|
67
|
+
)
|
|
68
|
+
raise ValueError(msg)
|
|
69
|
+
|
|
70
|
+
required_values = {
|
|
71
|
+
"identified": {"name": self.name, "public_url": self.public_url},
|
|
72
|
+
"anonymous": {"description": self.description, "search_url": self.search_url},
|
|
73
|
+
}[self.viewer_type]
|
|
74
|
+
null_fields = [name for name, value in required_values.items() if value is None]
|
|
75
|
+
if null_fields:
|
|
76
|
+
msg = (
|
|
77
|
+
f"{self.viewer_type} profile viewer requires non-null fields: "
|
|
78
|
+
f"{', '.join(sorted(null_fields))}"
|
|
79
|
+
)
|
|
80
|
+
raise ValueError(msg)
|
|
81
|
+
|
|
82
|
+
return self
|
|
@@ -45,6 +45,7 @@ class SearchCompaniesParams(BaseActionParams, LimitParams):
|
|
|
45
45
|
|
|
46
46
|
class SearchCompanyResult(LinkedApiModel):
|
|
47
47
|
name: str | None = None
|
|
48
|
+
urn: str | None = None
|
|
48
49
|
public_url: str | None = None
|
|
49
50
|
industry: str | None = None
|
|
50
51
|
location: str | None = None
|
|
@@ -68,6 +69,7 @@ class NvSearchCompaniesParams(BaseActionParams, LimitParams):
|
|
|
68
69
|
|
|
69
70
|
class NvSearchCompanyResult(LinkedApiModel):
|
|
70
71
|
name: str | None = None
|
|
72
|
+
urn: str | None = None
|
|
71
73
|
hashed_url: str | None = None
|
|
72
74
|
industry: str | None = None
|
|
73
75
|
employees_count: int | None = None
|
|
@@ -24,6 +24,7 @@ class SearchPeopleParams(BaseActionParams, LimitParams):
|
|
|
24
24
|
|
|
25
25
|
class SearchPeopleResult(LinkedApiModel):
|
|
26
26
|
name: str | None = None
|
|
27
|
+
urn: str | None = None
|
|
27
28
|
public_url: str | None = None
|
|
28
29
|
headline: str | None = None
|
|
29
30
|
location: str | None = None
|
|
@@ -42,6 +43,7 @@ class NvSearchPeopleParams(BaseActionParams, LimitParams):
|
|
|
42
43
|
|
|
43
44
|
class NvSearchPeopleResult(LinkedApiModel):
|
|
44
45
|
name: str | None = None
|
|
46
|
+
urn: str | None = None
|
|
45
47
|
hashed_url: str | None = None
|
|
46
48
|
position: str | None = None
|
|
47
49
|
location: str | None = None
|
|
@@ -101,6 +101,10 @@ class MessageWebhookEventData(LinkedApiModel):
|
|
|
101
101
|
account_id: str | None = None
|
|
102
102
|
type: ConversationType | None = None
|
|
103
103
|
thread_id: str | None = None
|
|
104
|
+
person_urn: str | None = None
|
|
105
|
+
person_hashed_url: str | None = None
|
|
106
|
+
person_public_url: str | None = None
|
|
107
|
+
# Deprecated: use person_hashed_url. Still returned by the API for compatibility.
|
|
104
108
|
person_url: str | None = None
|
|
105
109
|
message_id: str | None = None
|
|
106
110
|
sender: MessageSender | None = None
|
|
@@ -117,6 +121,7 @@ class MessageWebhookEvent(LinkedApiModel):
|
|
|
117
121
|
|
|
118
122
|
class NetworkWebhookEventData(LinkedApiModel):
|
|
119
123
|
account_id: str | None = None
|
|
124
|
+
person_urn: str | None = None
|
|
120
125
|
person_url: str | None = None
|
|
121
126
|
detected_at: str | None = None
|
|
122
127
|
|
|
@@ -59,6 +59,7 @@ def test_linked_api_exposes_all_predefined_operations() -> None:
|
|
|
59
59
|
"create_post",
|
|
60
60
|
"retrieve_ssi",
|
|
61
61
|
"retrieve_performance",
|
|
62
|
+
"retrieve_profile_viewers",
|
|
62
63
|
]
|
|
63
64
|
|
|
64
65
|
for name in operation_names:
|
|
@@ -66,7 +67,7 @@ def test_linked_api_exposes_all_predefined_operations() -> None:
|
|
|
66
67
|
assert hasattr(operation, "execute")
|
|
67
68
|
assert hasattr(operation, "result")
|
|
68
69
|
assert hasattr(operation, "cancel")
|
|
69
|
-
assert len(linkedapi.operations) ==
|
|
70
|
+
assert len(linkedapi.operations) == 39
|
|
70
71
|
|
|
71
72
|
|
|
72
73
|
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
|