linkedapi 1.4.7__tar.gz → 1.4.9__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 (129) hide show
  1. {linkedapi-1.4.7 → linkedapi-1.4.9}/PKG-INFO +1 -1
  2. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/__init__.py +3 -1
  3. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/client.py +3 -0
  4. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/errors.py +34 -0
  5. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/__init__.py +2 -0
  6. linkedapi-1.4.9/linkedapi/operations/nv_retrieve_alerts.py +12 -0
  7. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/types/__init__.py +10 -0
  8. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/types/admin/subscription.py +1 -1
  9. linkedapi-1.4.9/linkedapi/types/nv_alerts.py +41 -0
  10. {linkedapi-1.4.7 → linkedapi-1.4.9}/pyproject.toml +1 -1
  11. {linkedapi-1.4.7 → linkedapi-1.4.9}/tests/test_errors.py +17 -0
  12. linkedapi-1.4.9/tests/test_nv_retrieve_alerts.py +135 -0
  13. {linkedapi-1.4.7 → linkedapi-1.4.9}/tests/test_operations.py +2 -1
  14. {linkedapi-1.4.7 → linkedapi-1.4.9}/.github/workflows/publish.yaml +0 -0
  15. {linkedapi-1.4.7 → linkedapi-1.4.9}/.gitignore +0 -0
  16. {linkedapi-1.4.7 → linkedapi-1.4.9}/LICENSE +0 -0
  17. {linkedapi-1.4.7 → linkedapi-1.4.9}/README.md +0 -0
  18. {linkedapi-1.4.7 → linkedapi-1.4.9}/examples/verify_webhook_signature.py +0 -0
  19. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/admin/__init__.py +0 -0
  20. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/admin/accounts.py +0 -0
  21. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/admin/admin.py +0 -0
  22. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/admin/http_client.py +0 -0
  23. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/admin/limits.py +0 -0
  24. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/admin/subscription.py +0 -0
  25. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/admin/webhooks.py +0 -0
  26. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/changelog.py +0 -0
  27. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/config.py +0 -0
  28. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/core/__init__.py +0 -0
  29. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/core/operation.py +0 -0
  30. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/core/polling.py +0 -0
  31. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/http/__init__.py +0 -0
  32. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/http/base.py +0 -0
  33. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/http/linked_api_http_client.py +0 -0
  34. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/mappers/__init__.py +0 -0
  35. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/mappers/array.py +0 -0
  36. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/mappers/base.py +0 -0
  37. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/mappers/endorse_person_skills.py +0 -0
  38. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/mappers/send_message.py +0 -0
  39. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/mappers/simple.py +0 -0
  40. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/mappers/then.py +0 -0
  41. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/mappers/void.py +0 -0
  42. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/accept_invitation.py +0 -0
  43. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/check_connection_status.py +0 -0
  44. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/comment_on_post.py +0 -0
  45. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/create_post.py +0 -0
  46. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/create_repost.py +0 -0
  47. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/custom_workflow.py +0 -0
  48. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/endorse_person_skill.py +0 -0
  49. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/endorse_person_skills.py +0 -0
  50. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/fetch_company.py +0 -0
  51. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/fetch_job.py +0 -0
  52. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/fetch_person.py +0 -0
  53. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/fetch_post.py +0 -0
  54. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/ignore_invitation.py +0 -0
  55. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/manage_conversation.py +0 -0
  56. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/nv_fetch_company.py +0 -0
  57. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/nv_fetch_person.py +0 -0
  58. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/nv_manage_conversation.py +0 -0
  59. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/nv_search_companies.py +0 -0
  60. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/nv_search_people.py +0 -0
  61. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/nv_send_message.py +0 -0
  62. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/nv_sync_conversation.py +0 -0
  63. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/nv_sync_inbox.py +0 -0
  64. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/react_to_comment.py +0 -0
  65. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/react_to_post.py +0 -0
  66. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/remove_connection.py +0 -0
  67. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/reply_to_comment.py +0 -0
  68. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/retrieve_connections.py +0 -0
  69. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/retrieve_feed.py +0 -0
  70. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/retrieve_invitations.py +0 -0
  71. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/retrieve_pending_requests.py +0 -0
  72. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/retrieve_performance.py +0 -0
  73. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/retrieve_profile_viewers.py +0 -0
  74. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/retrieve_ssi.py +0 -0
  75. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/search_companies.py +0 -0
  76. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/search_jobs.py +0 -0
  77. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/search_people.py +0 -0
  78. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/search_posts.py +0 -0
  79. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/send_connection_request.py +0 -0
  80. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/send_message.py +0 -0
  81. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/sync_conversation.py +0 -0
  82. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/sync_inbox.py +0 -0
  83. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/sync_network.py +0 -0
  84. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/operations/withdraw_connection_request.py +0 -0
  85. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/py.typed +0 -0
  86. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/types/account.py +0 -0
  87. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/types/admin/__init__.py +0 -0
  88. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/types/admin/accounts.py +0 -0
  89. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/types/admin/config.py +0 -0
  90. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/types/admin/limits.py +0 -0
  91. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/types/base.py +0 -0
  92. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/types/changelog.py +0 -0
  93. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/types/company.py +0 -0
  94. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/types/connection.py +0 -0
  95. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/types/feed.py +0 -0
  96. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/types/jobs.py +0 -0
  97. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/types/message.py +0 -0
  98. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/types/network.py +0 -0
  99. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/types/params.py +0 -0
  100. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/types/person.py +0 -0
  101. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/types/post.py +0 -0
  102. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/types/profile_viewers.py +0 -0
  103. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/types/responses.py +0 -0
  104. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/types/search_companies.py +0 -0
  105. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/types/search_people.py +0 -0
  106. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/types/search_posts.py +0 -0
  107. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/types/statistics.py +0 -0
  108. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/types/viewer_state.py +0 -0
  109. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/types/webhooks.py +0 -0
  110. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/types/workflow.py +0 -0
  111. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/webhooks/__init__.py +0 -0
  112. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/webhooks/headers.py +0 -0
  113. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/webhooks/parse.py +0 -0
  114. {linkedapi-1.4.7 → linkedapi-1.4.9}/linkedapi/webhooks/signature.py +0 -0
  115. {linkedapi-1.4.7 → linkedapi-1.4.9}/tests/conftest.py +0 -0
  116. {linkedapi-1.4.7 → linkedapi-1.4.9}/tests/test_admin.py +0 -0
  117. {linkedapi-1.4.7 → linkedapi-1.4.9}/tests/test_admin_webhooks.py +0 -0
  118. {linkedapi-1.4.7 → linkedapi-1.4.9}/tests/test_changelog.py +0 -0
  119. {linkedapi-1.4.7 → linkedapi-1.4.9}/tests/test_direct_methods.py +0 -0
  120. {linkedapi-1.4.7 → linkedapi-1.4.9}/tests/test_endorse_operations.py +0 -0
  121. {linkedapi-1.4.7 → linkedapi-1.4.9}/tests/test_http_client.py +0 -0
  122. {linkedapi-1.4.7 → linkedapi-1.4.9}/tests/test_limits_categories.py +0 -0
  123. {linkedapi-1.4.7 → linkedapi-1.4.9}/tests/test_mappers.py +0 -0
  124. {linkedapi-1.4.7 → linkedapi-1.4.9}/tests/test_models.py +0 -0
  125. {linkedapi-1.4.7 → linkedapi-1.4.9}/tests/test_open_vocabularies.py +0 -0
  126. {linkedapi-1.4.7 → linkedapi-1.4.9}/tests/test_polling.py +0 -0
  127. {linkedapi-1.4.7 → linkedapi-1.4.9}/tests/test_webhook_signature.py +0 -0
  128. {linkedapi-1.4.7 → linkedapi-1.4.9}/tests/test_webhooks.py +0 -0
  129. {linkedapi-1.4.7 → linkedapi-1.4.9}/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.7
3
+ Version: 1.4.9
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
@@ -53,6 +53,7 @@ from linkedapi.operations import (
53
53
  NvFetchPerson,
54
54
  NvFetchPersonMapper,
55
55
  NvManageConversation,
56
+ NvRetrieveAlerts,
56
57
  NvSearchCompanies,
57
58
  NvSearchPeople,
58
59
  NvSendMessage,
@@ -89,7 +90,7 @@ from linkedapi.webhooks import (
89
90
  verify_webhook_signature,
90
91
  )
91
92
 
92
- __version__ = "1.4.7"
93
+ __version__ = "1.4.9"
93
94
  PredefinedOperation = Operation
94
95
 
95
96
  __all__ = [
@@ -137,6 +138,7 @@ __all__ = [
137
138
  "NvFetchPerson",
138
139
  "NvFetchPersonMapper",
139
140
  "NvManageConversation",
141
+ "NvRetrieveAlerts",
140
142
  "NvSearchCompanies",
141
143
  "NvSearchPeople",
142
144
  "NvSendMessage",
@@ -25,6 +25,7 @@ from linkedapi.operations import (
25
25
  NvFetchCompany,
26
26
  NvFetchPerson,
27
27
  NvManageConversation,
28
+ NvRetrieveAlerts,
28
29
  NvSearchCompanies,
29
30
  NvSearchPeople,
30
31
  NvSendMessage,
@@ -114,6 +115,7 @@ class LinkedApi:
114
115
  self.nv_sync_conversation = NvSyncConversation(self.http_client)
115
116
  self.nv_sync_inbox = NvSyncInbox(self.http_client)
116
117
  self.nv_manage_conversation = NvManageConversation(self.http_client)
118
+ self.nv_retrieve_alerts = NvRetrieveAlerts(self.http_client)
117
119
  self.nv_search_companies = NvSearchCompanies(self.http_client)
118
120
  self.nv_search_people = NvSearchPeople(self.http_client)
119
121
  self.nv_fetch_company = NvFetchCompany(self.http_client)
@@ -159,6 +161,7 @@ class LinkedApi:
159
161
  self.nv_sync_conversation,
160
162
  self.nv_sync_inbox,
161
163
  self.nv_manage_conversation,
164
+ self.nv_retrieve_alerts,
162
165
  self.nv_search_companies,
163
166
  self.nv_search_people,
164
167
  self.nv_fetch_company,
@@ -5,14 +5,17 @@ from typing import Any, Literal
5
5
  LinkedApiActionErrorType = Literal[
6
6
  "personNotFound",
7
7
  "selfProfileNotAllowed",
8
+ "personLikelyChangedPublicUrl",
8
9
  "messagingNotAllowed",
9
10
  "alreadyPending",
10
11
  "alreadyConnected",
11
12
  "emailRequired",
12
13
  "noteTooLong",
13
14
  "noteLimitExceeded",
15
+ "invitationAlreadyReceived",
14
16
  "requestNotAllowed",
15
17
  "notPending",
18
+ "noPendingRequest",
16
19
  "retrievingNotAllowed",
17
20
  "connectionNotFound",
18
21
  "skillNotFound",
@@ -20,6 +23,7 @@ LinkedApiActionErrorType = Literal[
20
23
  "limitExceeded",
21
24
  "searchingNotAllowed",
22
25
  "searchInterfaceMismatch",
26
+ "searchTemporarilyUnavailable",
23
27
  "filterNotApplied",
24
28
  "companyNotFound",
25
29
  "postNotFound",
@@ -29,24 +33,38 @@ LinkedApiActionErrorType = Literal[
29
33
  "replyingNotAllowed",
30
34
  "duplicateComment",
31
35
  "noPostingPermission",
36
+ "textTooLong",
37
+ "unsupportedAttachmentType",
38
+ "missingDocumentName",
39
+ "urlNotAccessible",
40
+ "fileTooLarge",
41
+ "unsupportedMimeType",
42
+ "tooManyAttachments",
43
+ "mixingNotAllowed",
32
44
  "mentionNotResolved",
33
45
  "repostNotAllowed",
34
46
  "alreadyReposted",
35
47
  "noSalesNavigator",
48
+ "salesNavigatorOnboardingRequired",
36
49
  "conversationsNotSynced",
37
50
  "threadNotFound",
51
+ "ssiNotAvailable",
52
+ "unexpectedError",
38
53
  ]
39
54
  LINKED_API_ACTION_ERROR_TYPES: tuple[str, ...] = (
40
55
  "personNotFound",
41
56
  "selfProfileNotAllowed",
57
+ "personLikelyChangedPublicUrl",
42
58
  "messagingNotAllowed",
43
59
  "alreadyPending",
44
60
  "alreadyConnected",
45
61
  "emailRequired",
46
62
  "noteTooLong",
47
63
  "noteLimitExceeded",
64
+ "invitationAlreadyReceived",
48
65
  "requestNotAllowed",
49
66
  "notPending",
67
+ "noPendingRequest",
50
68
  "retrievingNotAllowed",
51
69
  "connectionNotFound",
52
70
  "skillNotFound",
@@ -54,6 +72,7 @@ LINKED_API_ACTION_ERROR_TYPES: tuple[str, ...] = (
54
72
  "limitExceeded",
55
73
  "searchingNotAllowed",
56
74
  "searchInterfaceMismatch",
75
+ "searchTemporarilyUnavailable",
57
76
  "filterNotApplied",
58
77
  "companyNotFound",
59
78
  "postNotFound",
@@ -63,12 +82,23 @@ LINKED_API_ACTION_ERROR_TYPES: tuple[str, ...] = (
63
82
  "replyingNotAllowed",
64
83
  "duplicateComment",
65
84
  "noPostingPermission",
85
+ "textTooLong",
86
+ "unsupportedAttachmentType",
87
+ "missingDocumentName",
88
+ "urlNotAccessible",
89
+ "fileTooLarge",
90
+ "unsupportedMimeType",
91
+ "tooManyAttachments",
92
+ "mixingNotAllowed",
66
93
  "mentionNotResolved",
67
94
  "repostNotAllowed",
68
95
  "alreadyReposted",
69
96
  "noSalesNavigator",
97
+ "salesNavigatorOnboardingRequired",
70
98
  "conversationsNotSynced",
71
99
  "threadNotFound",
100
+ "ssiNotAvailable",
101
+ "unexpectedError",
72
102
  )
73
103
 
74
104
  LinkedApiErrorType = Literal[
@@ -86,6 +116,8 @@ LinkedApiErrorType = Literal[
86
116
  "workflowTimeout",
87
117
  "outsideWorkingHours",
88
118
  "workingHoursWaitExpired",
119
+ "cancelledByUser",
120
+ "unexpectedError",
89
121
  "httpError",
90
122
  "tooManyRequests",
91
123
  "accountNotFound",
@@ -109,6 +141,8 @@ LINKED_API_ERROR_TYPES: tuple[str, ...] = (
109
141
  "workflowTimeout",
110
142
  "outsideWorkingHours",
111
143
  "workingHoursWaitExpired",
144
+ "cancelledByUser",
145
+ "unexpectedError",
112
146
  "httpError",
113
147
  "tooManyRequests",
114
148
  "accountNotFound",
@@ -15,6 +15,7 @@ from linkedapi.operations.manage_conversation import ManageConversation
15
15
  from linkedapi.operations.nv_fetch_company import NvFetchCompany, NvFetchCompanyMapper
16
16
  from linkedapi.operations.nv_fetch_person import NvFetchPerson, NvFetchPersonMapper
17
17
  from linkedapi.operations.nv_manage_conversation import NvManageConversation
18
+ from linkedapi.operations.nv_retrieve_alerts import NvRetrieveAlerts
18
19
  from linkedapi.operations.nv_search_companies import NvSearchCompanies
19
20
  from linkedapi.operations.nv_search_people import NvSearchPeople
20
21
  from linkedapi.operations.nv_send_message import NvSendMessage
@@ -66,6 +67,7 @@ __all__ = [
66
67
  "NvFetchPerson",
67
68
  "NvFetchPersonMapper",
68
69
  "NvManageConversation",
70
+ "NvRetrieveAlerts",
69
71
  "NvSearchCompanies",
70
72
  "NvSearchPeople",
71
73
  "NvSendMessage",
@@ -0,0 +1,12 @@
1
+ from __future__ import annotations
2
+
3
+ from linkedapi.core import Operation
4
+ from linkedapi.mappers import ArrayWorkflowMapper
5
+ from linkedapi.types import NvAlert, NvRetrieveAlertsParams
6
+
7
+
8
+ class NvRetrieveAlerts(Operation[NvRetrieveAlertsParams, list[NvAlert]]):
9
+ """Retrieve Sales Navigator lead and account alerts."""
10
+
11
+ operation_name = "nvRetrieveAlerts"
12
+ mapper = ArrayWorkflowMapper[NvRetrieveAlertsParams, NvAlert]("nv.retrieveAlerts", NvAlert)
@@ -137,6 +137,12 @@ from linkedapi.types.network import (
137
137
  NetworkPollRequest,
138
138
  SyncNetworkParams,
139
139
  )
140
+ from linkedapi.types.nv_alerts import (
141
+ NvAlert,
142
+ NvAlertSubject,
143
+ NvRetrieveAlertsFilter,
144
+ NvRetrieveAlertsParams,
145
+ )
140
146
  from linkedapi.types.params import BaseActionParams, LimitParams, LimitSinceParams
141
147
  from linkedapi.types.person import (
142
148
  BaseFetchPersonParams,
@@ -410,6 +416,8 @@ __all__ = [
410
416
  "NetworkPollRequest",
411
417
  "NetworkWebhookEvent",
412
418
  "NetworkWebhookEventData",
419
+ "NvAlert",
420
+ "NvAlertSubject",
413
421
  "NvBaseFetchCompanyParams",
414
422
  "NvBaseFetchCompanyParamsWide",
415
423
  "NvCompany",
@@ -423,6 +431,8 @@ __all__ = [
423
431
  "NvManageConversationParams",
424
432
  "NvOpenPersonPageParams",
425
433
  "NvOpenPersonPageResult",
434
+ "NvRetrieveAlertsFilter",
435
+ "NvRetrieveAlertsParams",
426
436
  "NvSearchCompaniesFilter",
427
437
  "NvSearchCompaniesParams",
428
438
  "NvSearchCompanyResult",
@@ -4,7 +4,7 @@ from typing import Literal
4
4
 
5
5
  from linkedapi.types.base import LinkedApiModel
6
6
 
7
- SubscriptionStatusValue = Literal["active", "trialing", "past_due", "canceled"]
7
+ SubscriptionStatusValue = Literal["active", "trialing", "past_due", "unpaid", "canceled"]
8
8
  SeatType = Literal["core", "plus"]
9
9
  BillingPeriod = Literal["month", "year"]
10
10
  SetSeatsStatus = Literal["complete", "processing"]
@@ -0,0 +1,41 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import Literal
4
+
5
+ from pydantic import Field
6
+
7
+ from linkedapi.types.base import LinkedApiModel
8
+ from linkedapi.types.params import BaseActionParams
9
+
10
+
11
+ class NvRetrieveAlertsFilter(LinkedApiModel):
12
+ category: Literal["lead", "account"] | None = None
13
+ types: list[str] | None = None
14
+ since: str | None = None
15
+ exclude_suggested: bool | None = None
16
+
17
+
18
+ class NvRetrieveAlertsParams(BaseActionParams):
19
+ limit: int | None = Field(default=None, ge=1, le=1000)
20
+ sort: Literal["latest", "relevance"] | None = None
21
+ filter: NvRetrieveAlertsFilter | None = None
22
+
23
+
24
+ class NvAlertSubject(LinkedApiModel):
25
+ type: Literal["lead", "account"] | str
26
+ urn: str
27
+ name: str | None
28
+ url: str
29
+ saved: bool | None
30
+
31
+
32
+ class NvAlert(LinkedApiModel):
33
+ id: str
34
+ type: str
35
+ published_at: str
36
+ subject: NvAlertSubject
37
+ headline: str | None
38
+ text: str | None
39
+ subline: str | None
40
+ url: str | None
41
+ related_entity_urn: str | None
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "linkedapi"
7
- version = "1.4.7"
7
+ version = "1.4.9"
8
8
  description = "Official synchronous Python SDK for Linked API."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -23,6 +23,8 @@ def test_error_type_sets_match_node_contract() -> None:
23
23
  "workflowTimeout",
24
24
  "outsideWorkingHours",
25
25
  "workingHoursWaitExpired",
26
+ "cancelledByUser",
27
+ "unexpectedError",
26
28
  "httpError",
27
29
  "tooManyRequests",
28
30
  "accountNotFound",
@@ -34,14 +36,17 @@ def test_error_type_sets_match_node_contract() -> None:
34
36
  assert LINKED_API_ACTION_ERROR_TYPES == (
35
37
  "personNotFound",
36
38
  "selfProfileNotAllowed",
39
+ "personLikelyChangedPublicUrl",
37
40
  "messagingNotAllowed",
38
41
  "alreadyPending",
39
42
  "alreadyConnected",
40
43
  "emailRequired",
41
44
  "noteTooLong",
42
45
  "noteLimitExceeded",
46
+ "invitationAlreadyReceived",
43
47
  "requestNotAllowed",
44
48
  "notPending",
49
+ "noPendingRequest",
45
50
  "retrievingNotAllowed",
46
51
  "connectionNotFound",
47
52
  "skillNotFound",
@@ -49,6 +54,7 @@ def test_error_type_sets_match_node_contract() -> None:
49
54
  "limitExceeded",
50
55
  "searchingNotAllowed",
51
56
  "searchInterfaceMismatch",
57
+ "searchTemporarilyUnavailable",
52
58
  "filterNotApplied",
53
59
  "companyNotFound",
54
60
  "postNotFound",
@@ -58,12 +64,23 @@ def test_error_type_sets_match_node_contract() -> None:
58
64
  "replyingNotAllowed",
59
65
  "duplicateComment",
60
66
  "noPostingPermission",
67
+ "textTooLong",
68
+ "unsupportedAttachmentType",
69
+ "missingDocumentName",
70
+ "urlNotAccessible",
71
+ "fileTooLarge",
72
+ "unsupportedMimeType",
73
+ "tooManyAttachments",
74
+ "mixingNotAllowed",
61
75
  "mentionNotResolved",
62
76
  "repostNotAllowed",
63
77
  "alreadyReposted",
64
78
  "noSalesNavigator",
79
+ "salesNavigatorOnboardingRequired",
65
80
  "conversationsNotSynced",
66
81
  "threadNotFound",
82
+ "ssiNotAvailable",
83
+ "unexpectedError",
67
84
  )
68
85
 
69
86
 
@@ -0,0 +1,135 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import Any
4
+
5
+ import pytest
6
+ import requests_mock
7
+ from pydantic import ValidationError
8
+
9
+ from linkedapi import (
10
+ LinkedApi,
11
+ LinkedApiConfig,
12
+ NvAlert,
13
+ NvRetrieveAlertsFilter,
14
+ NvRetrieveAlertsParams,
15
+ )
16
+
17
+ ALERT = {
18
+ "id": "urn:li:notification:123",
19
+ "type": "FUTURE_MACHINE_TYPE",
20
+ "publishedAt": "2026-10-01T00:00:00.000Z",
21
+ "subject": {
22
+ "type": "lead",
23
+ "urn": "urn:li:fs_salesProfile:123",
24
+ "name": None,
25
+ "url": "https://www.linkedin.com/sales/lead/123",
26
+ "saved": None,
27
+ },
28
+ "headline": None,
29
+ "text": None,
30
+ "subline": None,
31
+ "url": None,
32
+ "relatedEntityUrn": None,
33
+ }
34
+
35
+
36
+ @pytest.mark.parametrize(
37
+ "params, expected",
38
+ [
39
+ (NvRetrieveAlertsParams(), {}),
40
+ (
41
+ NvRetrieveAlertsParams(
42
+ limit=1000,
43
+ sort="relevance",
44
+ filter=NvRetrieveAlertsFilter(
45
+ category="account",
46
+ types=["FUTURE_MACHINE_TYPE"],
47
+ since="2026-10-01T00:00:00Z",
48
+ exclude_suggested=True,
49
+ ),
50
+ ),
51
+ {
52
+ "limit": 1000,
53
+ "sort": "relevance",
54
+ "filter": {
55
+ "category": "account",
56
+ "types": ["FUTURE_MACHINE_TYPE"],
57
+ "since": "2026-10-01T00:00:00Z",
58
+ "excludeSuggested": True,
59
+ },
60
+ },
61
+ ),
62
+ (
63
+ NvRetrieveAlertsParams(
64
+ filter=NvRetrieveAlertsFilter(types=[], exclude_suggested=False)
65
+ ),
66
+ {"filter": {"types": [], "excludeSuggested": False}},
67
+ ),
68
+ ],
69
+ )
70
+ def test_alerts_root_mapping_and_nullable_result(
71
+ requests_mock: requests_mock.Mocker,
72
+ params: NvRetrieveAlertsParams,
73
+ expected: dict[str, Any],
74
+ ) -> None:
75
+ client = LinkedApi(
76
+ LinkedApiConfig(
77
+ linked_api_token="test", identification_token="test", base_url="https://api.test"
78
+ )
79
+ )
80
+ requests_mock.post(
81
+ "https://api.test/workflows",
82
+ json={"success": True, "result": {"workflowId": "alerts", "workflowStatus": "pending"}},
83
+ )
84
+ requests_mock.get(
85
+ "https://api.test/workflows/alerts",
86
+ json={
87
+ "success": True,
88
+ "result": {
89
+ "workflowStatus": "completed",
90
+ "completion": {"actionType": "nv.retrieveAlerts", "success": True, "data": [ALERT]},
91
+ },
92
+ },
93
+ )
94
+ operation = client.nv_retrieve_alerts
95
+ assert operation in client.operations
96
+ workflow = operation.execute(params)
97
+ result = operation.result(workflow.workflow_id)
98
+ assert requests_mock.request_history[0].json() == {
99
+ "actionType": "nv.retrieveAlerts",
100
+ **expected,
101
+ }
102
+ assert result.errors == []
103
+ assert result.data is not None
104
+ assert isinstance(result.data[0], NvAlert)
105
+ assert result.data[0].model_dump(by_alias=True) == ALERT
106
+
107
+
108
+ @pytest.mark.parametrize("limit", [0, 1001])
109
+ def test_alerts_limit_bounds(limit: int) -> None:
110
+ with pytest.raises(ValidationError):
111
+ NvRetrieveAlertsParams(limit=limit)
112
+
113
+
114
+ @pytest.mark.parametrize(
115
+ "completion, expected_data, expected_errors",
116
+ [
117
+ ({"success": True, "data": []}, [], []),
118
+ (
119
+ {"success": False, "error": {"type": "unexpectedError", "message": "Capture failed"}},
120
+ None,
121
+ [{"type": "unexpectedError", "message": "Capture failed"}],
122
+ ),
123
+ ],
124
+ )
125
+ def test_empty_alerts_and_failures_remain_distinct(
126
+ completion: dict[str, Any],
127
+ expected_data: list[Any] | None,
128
+ expected_errors: list[dict[str, str]],
129
+ ) -> None:
130
+ mapper = LinkedApi(
131
+ LinkedApiConfig(linked_api_token="test", identification_token="test")
132
+ ).nv_retrieve_alerts.mapper
133
+ result = mapper.map_response({"actionType": "nv.retrieveAlerts", **completion})
134
+ assert result.data == expected_data
135
+ assert [error.model_dump() for error in result.errors] == expected_errors
@@ -59,6 +59,7 @@ def test_linked_api_exposes_all_predefined_operations() -> None:
59
59
  "nv_sync_conversation",
60
60
  "nv_sync_inbox",
61
61
  "nv_manage_conversation",
62
+ "nv_retrieve_alerts",
62
63
  "react_to_post",
63
64
  "endorse_person_skill",
64
65
  "endorse_person_skills",
@@ -77,7 +78,7 @@ def test_linked_api_exposes_all_predefined_operations() -> None:
77
78
  assert hasattr(operation, "execute")
78
79
  assert hasattr(operation, "result")
79
80
  assert hasattr(operation, "cancel")
80
- assert len(linkedapi.operations) == 43
81
+ assert len(linkedapi.operations) == 44
81
82
 
82
83
 
83
84
  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