Skip to content

Commit e5a29b2

Browse files
Add the error types and subscription fields Core returns today
Action errors: salesNavigatorOnboardingRequired and searchTemporarilyUnavailable (Sales Navigator searches), plus types Core already returned without an entry here: personLikelyChangedPublicUrl, invitationAlreadyReceived, noPendingRequest, ssiNotAvailable, unexpectedError, textTooLong and the create_post attachment errors. Request and workflow errors: the failure reasons cancelledByUser, workflowInterrupted and unexpectedError, and the subscription.setSeats errors firstPaymentBusy, firstPaymentTimeout, firstPaymentInProgress and firstPaymentOfferConflict. SubscriptionStatus: first_payment_status, first_payment_checkout_url and first_payment_is_trial, which the model silently dropped, and the unpaid status. Version 1.4.8.
1 parent d01ccfb commit e5a29b2

8 files changed

Lines changed: 78 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: 44 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,13 +116,20 @@
86116
"workflowTimeout",
87117
"outsideWorkingHours",
88118
"workingHoursWaitExpired",
119+
"cancelledByUser",
120+
"workflowInterrupted",
121+
"unexpectedError",
89122
"httpError",
90123
"tooManyRequests",
91124
"accountNotFound",
92125
"accountIdRequired",
93126
"sessionNotFound",
94127
"noAvailableSeats",
95128
"dailyConnectionAttemptsExceeded",
129+
"firstPaymentBusy",
130+
"firstPaymentTimeout",
131+
"firstPaymentInProgress",
132+
"firstPaymentOfferConflict",
96133
]
97134
LINKED_API_ERROR_TYPES: tuple[str, ...] = (
98135
"linkedApiTokenRequired",
@@ -109,13 +146,20 @@
109146
"workflowTimeout",
110147
"outsideWorkingHours",
111148
"workingHoursWaitExpired",
149+
"cancelledByUser",
150+
"workflowInterrupted",
151+
"unexpectedError",
112152
"httpError",
113153
"tooManyRequests",
114154
"accountNotFound",
115155
"accountIdRequired",
116156
"sessionNotFound",
117157
"noAvailableSeats",
118158
"dailyConnectionAttemptsExceeded",
159+
"firstPaymentBusy",
160+
"firstPaymentTimeout",
161+
"firstPaymentInProgress",
162+
"firstPaymentOfferConflict",
119163
)
120164

121165

‎linkedapi/types/__init__.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
DeleteLimitEntry,
1616
DeleteLimitsParams,
1717
DisconnectParams,
18+
FirstPaymentStatus,
1819
GetConnectionSessionParams,
1920
GetLimitsParams,
2021
GetLimitsUsageParams,
@@ -362,6 +363,7 @@
362363
"FetchPersonResult",
363364
"FetchPostParams",
364365
"FetchPostResult",
366+
"FirstPaymentStatus",
365367
"GetConnectionSessionParams",
366368
"GetLimitsParams",
367369
"GetLimitsUsageParams",

‎linkedapi/types/admin/__init__.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
)
3636
from linkedapi.types.admin.subscription import (
3737
BillingPeriod,
38+
FirstPaymentStatus,
3839
SeatType,
3940
SetSeatsParams,
4041
SetSeatsResult,
@@ -61,6 +62,7 @@
6162
"DeleteLimitEntry",
6263
"DeleteLimitsParams",
6364
"DisconnectParams",
65+
"FirstPaymentStatus",
6466
"GetConnectionSessionParams",
6567
"GetLimitsParams",
6668
"GetLimitsUsageParams",

‎linkedapi/types/admin/subscription.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,20 @@
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"]
11+
FirstPaymentStatus = Literal["none", "checkoutOpen", "synchronizing", "unavailable"]
1112

1213

1314
class SubscriptionStatus(LinkedApiModel):
1415
status: SubscriptionStatusValue | str | None = None
1516
eligible_for_trial: bool | None = None
1617
cancel_at_period_end: bool | None = None
18+
first_payment_status: FirstPaymentStatus | str | None = None
19+
first_payment_checkout_url: str | None = None
20+
first_payment_is_trial: bool | None = None
1721

1822

1923
class SubscriptionSeat(LinkedApiModel):

‎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: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,32 +23,43 @@ def test_error_type_sets_match_node_contract() -> None:
2323
"workflowTimeout",
2424
"outsideWorkingHours",
2525
"workingHoursWaitExpired",
26+
"cancelledByUser",
27+
"workflowInterrupted",
28+
"unexpectedError",
2629
"httpError",
2730
"tooManyRequests",
2831
"accountNotFound",
2932
"accountIdRequired",
3033
"sessionNotFound",
3134
"noAvailableSeats",
3235
"dailyConnectionAttemptsExceeded",
36+
"firstPaymentBusy",
37+
"firstPaymentTimeout",
38+
"firstPaymentInProgress",
39+
"firstPaymentOfferConflict",
3340
)
3441
assert LINKED_API_ACTION_ERROR_TYPES == (
3542
"personNotFound",
3643
"selfProfileNotAllowed",
44+
"personLikelyChangedPublicUrl",
3745
"messagingNotAllowed",
3846
"alreadyPending",
3947
"alreadyConnected",
4048
"emailRequired",
4149
"noteTooLong",
4250
"noteLimitExceeded",
51+
"invitationAlreadyReceived",
4352
"requestNotAllowed",
4453
"notPending",
54+
"noPendingRequest",
4555
"retrievingNotAllowed",
4656
"connectionNotFound",
4757
"skillNotFound",
4858
"endorsementUnavailable",
4959
"limitExceeded",
5060
"searchingNotAllowed",
5161
"searchInterfaceMismatch",
62+
"searchTemporarilyUnavailable",
5263
"filterNotApplied",
5364
"companyNotFound",
5465
"postNotFound",
@@ -58,12 +69,23 @@ def test_error_type_sets_match_node_contract() -> None:
5869
"replyingNotAllowed",
5970
"duplicateComment",
6071
"noPostingPermission",
72+
"textTooLong",
73+
"unsupportedAttachmentType",
74+
"missingDocumentName",
75+
"urlNotAccessible",
76+
"fileTooLarge",
77+
"unsupportedMimeType",
78+
"tooManyAttachments",
79+
"mixingNotAllowed",
6180
"mentionNotResolved",
6281
"repostNotAllowed",
6382
"alreadyReposted",
6483
"noSalesNavigator",
84+
"salesNavigatorOnboardingRequired",
6585
"conversationsNotSynced",
6686
"threadNotFound",
87+
"ssiNotAvailable",
88+
"unexpectedError",
6789
)
6890

6991

‎tests/test_open_vocabularies.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
("SubscriptionSeat", "seat_type", "core"),
6262
("SubscriptionSeat", "billing_period", "month"),
6363
("SubscriptionStatus", "status", "active"),
64+
("SubscriptionStatus", "first_payment_status", "none"),
6465
("WebhookDelivery", "status", "pending"),
6566
("WebhookSubscription", "payload_mode", "thin"),
6667
("WebhookTestEvent", "type", "webhook.test"),

0 commit comments

Comments
 (0)