From 7c39615f5b45df41edbc4eef1885d2d1aa863bab Mon Sep 17 00:00:00 2001 From: Kiril Date: Wed, 28 Oct 2026 11:29:30 +0100 Subject: [PATCH] Add error types to SDK --- linkedapi/__init__.py | 2 +- linkedapi/errors.py | 34 +++++++++++++++++++++++++++ linkedapi/types/admin/subscription.py | 2 +- pyproject.toml | 2 +- tests/test_errors.py | 17 ++++++++++++++ 5 files changed, 54 insertions(+), 3 deletions(-) diff --git a/linkedapi/__init__.py b/linkedapi/__init__.py index c5e3c58..5426e96 100644 --- a/linkedapi/__init__.py +++ b/linkedapi/__init__.py @@ -89,7 +89,7 @@ verify_webhook_signature, ) -__version__ = "1.4.7" +__version__ = "1.4.8" PredefinedOperation = Operation __all__ = [ diff --git a/linkedapi/errors.py b/linkedapi/errors.py index 065d796..7eca539 100644 --- a/linkedapi/errors.py +++ b/linkedapi/errors.py @@ -5,14 +5,17 @@ LinkedApiActionErrorType = Literal[ "personNotFound", "selfProfileNotAllowed", + "personLikelyChangedPublicUrl", "messagingNotAllowed", "alreadyPending", "alreadyConnected", "emailRequired", "noteTooLong", "noteLimitExceeded", + "invitationAlreadyReceived", "requestNotAllowed", "notPending", + "noPendingRequest", "retrievingNotAllowed", "connectionNotFound", "skillNotFound", @@ -20,6 +23,7 @@ "limitExceeded", "searchingNotAllowed", "searchInterfaceMismatch", + "searchTemporarilyUnavailable", "filterNotApplied", "companyNotFound", "postNotFound", @@ -29,24 +33,38 @@ "replyingNotAllowed", "duplicateComment", "noPostingPermission", + "textTooLong", + "unsupportedAttachmentType", + "missingDocumentName", + "urlNotAccessible", + "fileTooLarge", + "unsupportedMimeType", + "tooManyAttachments", + "mixingNotAllowed", "mentionNotResolved", "repostNotAllowed", "alreadyReposted", "noSalesNavigator", + "salesNavigatorOnboardingRequired", "conversationsNotSynced", "threadNotFound", + "ssiNotAvailable", + "unexpectedError", ] LINKED_API_ACTION_ERROR_TYPES: tuple[str, ...] = ( "personNotFound", "selfProfileNotAllowed", + "personLikelyChangedPublicUrl", "messagingNotAllowed", "alreadyPending", "alreadyConnected", "emailRequired", "noteTooLong", "noteLimitExceeded", + "invitationAlreadyReceived", "requestNotAllowed", "notPending", + "noPendingRequest", "retrievingNotAllowed", "connectionNotFound", "skillNotFound", @@ -54,6 +72,7 @@ "limitExceeded", "searchingNotAllowed", "searchInterfaceMismatch", + "searchTemporarilyUnavailable", "filterNotApplied", "companyNotFound", "postNotFound", @@ -63,12 +82,23 @@ "replyingNotAllowed", "duplicateComment", "noPostingPermission", + "textTooLong", + "unsupportedAttachmentType", + "missingDocumentName", + "urlNotAccessible", + "fileTooLarge", + "unsupportedMimeType", + "tooManyAttachments", + "mixingNotAllowed", "mentionNotResolved", "repostNotAllowed", "alreadyReposted", "noSalesNavigator", + "salesNavigatorOnboardingRequired", "conversationsNotSynced", "threadNotFound", + "ssiNotAvailable", + "unexpectedError", ) LinkedApiErrorType = Literal[ @@ -86,6 +116,8 @@ "workflowTimeout", "outsideWorkingHours", "workingHoursWaitExpired", + "cancelledByUser", + "unexpectedError", "httpError", "tooManyRequests", "accountNotFound", @@ -109,6 +141,8 @@ "workflowTimeout", "outsideWorkingHours", "workingHoursWaitExpired", + "cancelledByUser", + "unexpectedError", "httpError", "tooManyRequests", "accountNotFound", diff --git a/linkedapi/types/admin/subscription.py b/linkedapi/types/admin/subscription.py index bdba1c1..1910822 100644 --- a/linkedapi/types/admin/subscription.py +++ b/linkedapi/types/admin/subscription.py @@ -4,7 +4,7 @@ from linkedapi.types.base import LinkedApiModel -SubscriptionStatusValue = Literal["active", "trialing", "past_due", "canceled"] +SubscriptionStatusValue = Literal["active", "trialing", "past_due", "unpaid", "canceled"] SeatType = Literal["core", "plus"] BillingPeriod = Literal["month", "year"] SetSeatsStatus = Literal["complete", "processing"] diff --git a/pyproject.toml b/pyproject.toml index ff3ab82..855c333 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "linkedapi" -version = "1.4.7" +version = "1.4.8" description = "Official synchronous Python SDK for Linked API." readme = "README.md" requires-python = ">=3.10" diff --git a/tests/test_errors.py b/tests/test_errors.py index 2805e04..1d02c0a 100644 --- a/tests/test_errors.py +++ b/tests/test_errors.py @@ -23,6 +23,8 @@ def test_error_type_sets_match_node_contract() -> None: "workflowTimeout", "outsideWorkingHours", "workingHoursWaitExpired", + "cancelledByUser", + "unexpectedError", "httpError", "tooManyRequests", "accountNotFound", @@ -34,14 +36,17 @@ def test_error_type_sets_match_node_contract() -> None: assert LINKED_API_ACTION_ERROR_TYPES == ( "personNotFound", "selfProfileNotAllowed", + "personLikelyChangedPublicUrl", "messagingNotAllowed", "alreadyPending", "alreadyConnected", "emailRequired", "noteTooLong", "noteLimitExceeded", + "invitationAlreadyReceived", "requestNotAllowed", "notPending", + "noPendingRequest", "retrievingNotAllowed", "connectionNotFound", "skillNotFound", @@ -49,6 +54,7 @@ def test_error_type_sets_match_node_contract() -> None: "limitExceeded", "searchingNotAllowed", "searchInterfaceMismatch", + "searchTemporarilyUnavailable", "filterNotApplied", "companyNotFound", "postNotFound", @@ -58,12 +64,23 @@ def test_error_type_sets_match_node_contract() -> None: "replyingNotAllowed", "duplicateComment", "noPostingPermission", + "textTooLong", + "unsupportedAttachmentType", + "missingDocumentName", + "urlNotAccessible", + "fileTooLarge", + "unsupportedMimeType", + "tooManyAttachments", + "mixingNotAllowed", "mentionNotResolved", "repostNotAllowed", "alreadyReposted", "noSalesNavigator", + "salesNavigatorOnboardingRequired", "conversationsNotSynced", "threadNotFound", + "ssiNotAvailable", + "unexpectedError", )