Skip to content

Commit 2e88a6b

Browse files
Add error types to SDK (#4)
1 parent d01ccfb commit 2e88a6b

5 files changed

Lines changed: 54 additions & 3 deletions

File tree

‎linkedapi/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
verify_webhook_signature,
9090
)
9191

92-
__version__ = "1.4.7"
92+
__version__ = "1.4.8"
9393
PredefinedOperation = Operation
9494

9595
__all__ = [

‎linkedapi/errors.py‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,25 @@
55
LinkedApiActionErrorType = Literal[
66
"personNotFound",
77
"selfProfileNotAllowed",
8+
"personLikelyChangedPublicUrl",
89
"messagingNotAllowed",
910
"alreadyPending",
1011
"alreadyConnected",
1112
"emailRequired",
1213
"noteTooLong",
1314
"noteLimitExceeded",
15+
"invitationAlreadyReceived",
1416
"requestNotAllowed",
1517
"notPending",
18+
"noPendingRequest",
1619
"retrievingNotAllowed",
1720
"connectionNotFound",
1821
"skillNotFound",
1922
"endorsementUnavailable",
2023
"limitExceeded",
2124
"searchingNotAllowed",
2225
"searchInterfaceMismatch",
26+
"searchTemporarilyUnavailable",
2327
"filterNotApplied",
2428
"companyNotFound",
2529
"postNotFound",
@@ -29,31 +33,46 @@
2933
"replyingNotAllowed",
3034
"duplicateComment",
3135
"noPostingPermission",
36+
"textTooLong",
37+
"unsupportedAttachmentType",
38+
"missingDocumentName",
39+
"urlNotAccessible",
40+
"fileTooLarge",
41+
"unsupportedMimeType",
42+
"tooManyAttachments",
43+
"mixingNotAllowed",
3244
"mentionNotResolved",
3345
"repostNotAllowed",
3446
"alreadyReposted",
3547
"noSalesNavigator",
48+
"salesNavigatorOnboardingRequired",
3649
"conversationsNotSynced",
3750
"threadNotFound",
51+
"ssiNotAvailable",
52+
"unexpectedError",
3853
]
3954
LINKED_API_ACTION_ERROR_TYPES: tuple[str, ...] = (
4055
"personNotFound",
4156
"selfProfileNotAllowed",
57+
"personLikelyChangedPublicUrl",
4258
"messagingNotAllowed",
4359
"alreadyPending",
4460
"alreadyConnected",
4561
"emailRequired",
4662
"noteTooLong",
4763
"noteLimitExceeded",
64+
"invitationAlreadyReceived",
4865
"requestNotAllowed",
4966
"notPending",
67+
"noPendingRequest",
5068
"retrievingNotAllowed",
5169
"connectionNotFound",
5270
"skillNotFound",
5371
"endorsementUnavailable",
5472
"limitExceeded",
5573
"searchingNotAllowed",
5674
"searchInterfaceMismatch",
75+
"searchTemporarilyUnavailable",
5776
"filterNotApplied",
5877
"companyNotFound",
5978
"postNotFound",
@@ -63,12 +82,23 @@
6382
"replyingNotAllowed",
6483
"duplicateComment",
6584
"noPostingPermission",
85+
"textTooLong",
86+
"unsupportedAttachmentType",
87+
"missingDocumentName",
88+
"urlNotAccessible",
89+
"fileTooLarge",
90+
"unsupportedMimeType",
91+
"tooManyAttachments",
92+
"mixingNotAllowed",
6693
"mentionNotResolved",
6794
"repostNotAllowed",
6895
"alreadyReposted",
6996
"noSalesNavigator",
97+
"salesNavigatorOnboardingRequired",
7098
"conversationsNotSynced",
7199
"threadNotFound",
100+
"ssiNotAvailable",
101+
"unexpectedError",
72102
)
73103

74104
LinkedApiErrorType = Literal[
@@ -86,6 +116,8 @@
86116
"workflowTimeout",
87117
"outsideWorkingHours",
88118
"workingHoursWaitExpired",
119+
"cancelledByUser",
120+
"unexpectedError",
89121
"httpError",
90122
"tooManyRequests",
91123
"accountNotFound",
@@ -109,6 +141,8 @@
109141
"workflowTimeout",
110142
"outsideWorkingHours",
111143
"workingHoursWaitExpired",
144+
"cancelledByUser",
145+
"unexpectedError",
112146
"httpError",
113147
"tooManyRequests",
114148
"accountNotFound",

‎linkedapi/types/admin/subscription.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from linkedapi.types.base import LinkedApiModel
66

7-
SubscriptionStatusValue = Literal["active", "trialing", "past_due", "canceled"]
7+
SubscriptionStatusValue = Literal["active", "trialing", "past_due", "unpaid", "canceled"]
88
SeatType = Literal["core", "plus"]
99
BillingPeriod = Literal["month", "year"]
1010
SetSeatsStatus = Literal["complete", "processing"]

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "linkedapi"
7-
version = "1.4.7"
7+
version = "1.4.8"
88
description = "Official synchronous Python SDK for Linked API."
99
readme = "README.md"
1010
requires-python = ">=3.10"

‎tests/test_errors.py‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ def test_error_type_sets_match_node_contract() -> None:
2323
"workflowTimeout",
2424
"outsideWorkingHours",
2525
"workingHoursWaitExpired",
26+
"cancelledByUser",
27+
"unexpectedError",
2628
"httpError",
2729
"tooManyRequests",
2830
"accountNotFound",
@@ -34,21 +36,25 @@ def test_error_type_sets_match_node_contract() -> None:
3436
assert LINKED_API_ACTION_ERROR_TYPES == (
3537
"personNotFound",
3638
"selfProfileNotAllowed",
39+
"personLikelyChangedPublicUrl",
3740
"messagingNotAllowed",
3841
"alreadyPending",
3942
"alreadyConnected",
4043
"emailRequired",
4144
"noteTooLong",
4245
"noteLimitExceeded",
46+
"invitationAlreadyReceived",
4347
"requestNotAllowed",
4448
"notPending",
49+
"noPendingRequest",
4550
"retrievingNotAllowed",
4651
"connectionNotFound",
4752
"skillNotFound",
4853
"endorsementUnavailable",
4954
"limitExceeded",
5055
"searchingNotAllowed",
5156
"searchInterfaceMismatch",
57+
"searchTemporarilyUnavailable",
5258
"filterNotApplied",
5359
"companyNotFound",
5460
"postNotFound",
@@ -58,12 +64,23 @@ def test_error_type_sets_match_node_contract() -> None:
5864
"replyingNotAllowed",
5965
"duplicateComment",
6066
"noPostingPermission",
67+
"textTooLong",
68+
"unsupportedAttachmentType",
69+
"missingDocumentName",
70+
"urlNotAccessible",
71+
"fileTooLarge",
72+
"unsupportedMimeType",
73+
"tooManyAttachments",
74+
"mixingNotAllowed",
6175
"mentionNotResolved",
6276
"repostNotAllowed",
6377
"alreadyReposted",
6478
"noSalesNavigator",
79+
"salesNavigatorOnboardingRequired",
6580
"conversationsNotSynced",
6681
"threadNotFound",
82+
"ssiNotAvailable",
83+
"unexpectedError",
6784
)
6885

6986

0 commit comments

Comments
 (0)