Skip to content

Commit 343d5d3

Browse files
Fix admin methods
1 parent df6584e commit 343d5d3

7 files changed

Lines changed: 13 additions & 78 deletions

File tree

linkedapi/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
from linkedapi.types import * # noqa: F403
6666
from linkedapi.types import __all__ as _types_all
6767

68-
__version__ = "1.0.3"
68+
__version__ = "1.0.4"
6969
PredefinedOperation = Operation
7070

7171
__all__ = [

linkedapi/admin/subscription.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@
77
from linkedapi.errors import LinkedApiError
88
from linkedapi.http import HttpClient
99
from linkedapi.types.admin import (
10-
BillingLinkResult,
11-
CancelResult,
1210
SetSeatsParams,
1311
SetSeatsResult,
14-
SubscriptionPricingResult,
1512
SubscriptionSeatsResult,
1613
SubscriptionStatus,
1714
)
@@ -33,26 +30,11 @@ def get_seats(self) -> SubscriptionSeatsResult:
3330
"/admin/subscription.getSeats", SubscriptionSeatsResult, "Failed to get seats"
3431
)
3532

36-
def get_pricing(self) -> SubscriptionPricingResult:
37-
return self._post_result(
38-
"/admin/subscription.getPricing", SubscriptionPricingResult, "Failed to get pricing"
39-
)
40-
4133
def set_seats(self, params: SetSeatsParams) -> SetSeatsResult:
4234
return self._post_result(
4335
"/admin/subscription.setSeats", SetSeatsResult, "Failed to set seats", params
4436
)
4537

46-
def get_billing_link(self) -> BillingLinkResult:
47-
return self._post_result(
48-
"/admin/subscription.getBillingLink", BillingLinkResult, "Failed to get billing link"
49-
)
50-
51-
def cancel(self) -> CancelResult:
52-
return self._post_result(
53-
"/admin/subscription.cancel", CancelResult, "Failed to cancel subscription"
54-
)
55-
5638
def _post_result(
5739
self,
5840
path: str,

linkedapi/types/__init__.py

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,14 @@
44
AdminAccount,
55
AdminAccountStatus,
66
AdminConfig,
7-
BillingLinkResult,
87
BillingPeriod,
98
CancelConnectionSessionParams,
10-
CancelResult,
119
ConnectionSession,
1210
ConnectionSessionResult,
1311
ConnectionSessionStatus,
1412
CreateConnectionSessionResult,
1513
CreateReconnectionSessionParams,
1614
CreateReconnectionSessionResult,
17-
Currency,
1815
DeleteLimitEntry,
1916
DeleteLimitsParams,
2017
DisconnectParams,
@@ -28,19 +25,17 @@
2825
LimitUsage,
2926
LimitUsageResult,
3027
PendingConnectionSession,
31-
ReparseAccountInfoParams,
32-
ReparseAccountInfoResult,
3328
RegenerateTokenParams,
3429
RegenerateTokenResult,
30+
ReparseAccountInfoParams,
31+
ReparseAccountInfoResult,
3532
ResetLimitsParams,
3633
SeatType,
3734
SetLimitEntry,
3835
SetLimitsParams,
3936
SetSeatsParams,
4037
SetSeatsResult,
4138
SetSeatsStatus,
42-
SubscriptionPricingResult,
43-
SubscriptionProduct,
4439
SubscriptionSeat,
4540
SubscriptionSeatsResult,
4641
SubscriptionStatus,
@@ -214,10 +209,8 @@
214209
"BaseFetchPersonParamsWide",
215210
"BaseFetchPostParams",
216211
"BaseFetchPostParamsWide",
217-
"BillingLinkResult",
218212
"BillingPeriod",
219213
"CancelConnectionSessionParams",
220-
"CancelResult",
221214
"CheckConnectionStatusParams",
222215
"CheckConnectionStatusResult",
223216
"Comment",
@@ -232,12 +225,11 @@
232225
"ConversationPollResult",
233226
"ConversationType",
234227
"CreateConnectionSessionResult",
235-
"CreateReconnectionSessionParams",
236-
"CreateReconnectionSessionResult",
237228
"CreatePostAttachment",
238229
"CreatePostParams",
239230
"CreatePostResult",
240-
"Currency",
231+
"CreateReconnectionSessionParams",
232+
"CreateReconnectionSessionResult",
241233
"DeleteLimitEntry",
242234
"DeleteLimitsParams",
243235
"DisconnectParams",
@@ -318,11 +310,11 @@
318310
"ReactToPostParams",
319311
"Reaction",
320312
"ReactionType",
321-
"ReparseAccountInfoParams",
322-
"ReparseAccountInfoResult",
323313
"RegenerateTokenParams",
324314
"RegenerateTokenResult",
325315
"RemoveConnectionParams",
316+
"ReparseAccountInfoParams",
317+
"ReparseAccountInfoResult",
326318
"ResetLimitsParams",
327319
"RetrieveConnectionsFilter",
328320
"RetrieveConnectionsParams",
@@ -353,8 +345,6 @@
353345
"StCompanyEmployee",
354346
"StCompanyEmployeesFilter",
355347
"StCompanyEmployeesRetrievalConfig",
356-
"SubscriptionPricingResult",
357-
"SubscriptionProduct",
358348
"SubscriptionSeat",
359349
"SubscriptionSeatsResult",
360350
"SubscriptionStatus",

linkedapi/types/admin/__init__.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
DisconnectParams,
1313
GetConnectionSessionParams,
1414
PendingConnectionSession,
15-
ReparseAccountInfoParams,
16-
ReparseAccountInfoResult,
1715
RegenerateTokenParams,
1816
RegenerateTokenResult,
17+
ReparseAccountInfoParams,
18+
ReparseAccountInfoResult,
1919
)
2020
from linkedapi.types.admin.config import AdminConfig
2121
from linkedapi.types.admin.limits import (
@@ -34,16 +34,11 @@
3434
SetLimitsParams,
3535
)
3636
from linkedapi.types.admin.subscription import (
37-
BillingLinkResult,
3837
BillingPeriod,
39-
CancelResult,
40-
Currency,
4138
SeatType,
4239
SetSeatsParams,
4340
SetSeatsResult,
4441
SetSeatsStatus,
45-
SubscriptionPricingResult,
46-
SubscriptionProduct,
4742
SubscriptionSeat,
4843
SubscriptionSeatsResult,
4944
SubscriptionStatus,
@@ -55,17 +50,14 @@
5550
"AdminAccount",
5651
"AdminAccountStatus",
5752
"AdminConfig",
58-
"BillingLinkResult",
5953
"BillingPeriod",
6054
"CancelConnectionSessionParams",
61-
"CancelResult",
6255
"ConnectionSession",
6356
"ConnectionSessionResult",
6457
"ConnectionSessionStatus",
6558
"CreateConnectionSessionResult",
6659
"CreateReconnectionSessionParams",
6760
"CreateReconnectionSessionResult",
68-
"Currency",
6961
"DeleteLimitEntry",
7062
"DeleteLimitsParams",
7163
"DisconnectParams",
@@ -79,19 +71,17 @@
7971
"LimitUsageResult",
8072
"LimitsResult",
8173
"PendingConnectionSession",
82-
"ReparseAccountInfoParams",
83-
"ReparseAccountInfoResult",
8474
"RegenerateTokenParams",
8575
"RegenerateTokenResult",
76+
"ReparseAccountInfoParams",
77+
"ReparseAccountInfoResult",
8678
"ResetLimitsParams",
8779
"SeatType",
8880
"SetLimitEntry",
8981
"SetLimitsParams",
9082
"SetSeatsParams",
9183
"SetSeatsResult",
9284
"SetSeatsStatus",
93-
"SubscriptionPricingResult",
94-
"SubscriptionProduct",
9585
"SubscriptionSeat",
9686
"SubscriptionSeatsResult",
9787
"SubscriptionStatus",

linkedapi/types/admin/subscription.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
SubscriptionStatusValue = Literal["active", "trialing", "past_due", "canceled"]
88
SeatType = Literal["core", "plus"]
99
BillingPeriod = Literal["month", "year"]
10-
Currency = Literal["usd", "eur"]
1110
SetSeatsStatus = Literal["complete", "processing"]
1211

1312

@@ -23,14 +22,6 @@ class SubscriptionSeat(LinkedApiModel):
2322
billing_period: BillingPeriod | None = None
2423

2524

26-
class SubscriptionProduct(LinkedApiModel):
27-
id: str | None = None
28-
seat_type: SeatType | None = None
29-
billing_period: BillingPeriod | None = None
30-
unit_price: int | None = None
31-
currency: Currency | None = None
32-
33-
3425
class SetSeatsParams(LinkedApiModel):
3526
quantity: int
3627
seat_type: SeatType
@@ -42,17 +33,5 @@ class SetSeatsResult(LinkedApiModel):
4233
payment_link: str | None = None
4334

4435

45-
class BillingLinkResult(LinkedApiModel):
46-
stripe_link: str | None = None
47-
48-
49-
class CancelResult(LinkedApiModel):
50-
cancel_at_date: str | None = None
51-
52-
5336
class SubscriptionSeatsResult(LinkedApiModel):
5437
seats: list[SubscriptionSeat] | None = None
55-
56-
57-
class SubscriptionPricingResult(LinkedApiModel):
58-
products: list[SubscriptionProduct] | None = None

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.0.3"
7+
version = "1.0.4"
88
description = "Official synchronous Python SDK for Linked API."
99
readme = "README.md"
1010
requires-python = ">=3.10"

tests/test_admin.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
GetLimitsParams,
1717
GetLimitsUsageParams,
1818
LinkedApiAdmin,
19-
ReparseAccountInfoParams,
2019
RegenerateTokenParams,
20+
ReparseAccountInfoParams,
2121
ResetLimitsParams,
2222
SetLimitEntry,
2323
SetLimitsParams,
@@ -61,10 +61,7 @@ def test_admin_methods_use_node_paths(requests_mock: requests_mock.Mocker) -> No
6161
{"status": "active", "eligibleForTrial": False, "cancelAtPeriodEnd": False},
6262
),
6363
("/admin/subscription.getSeats", {"seats": []}),
64-
("/admin/subscription.getPricing", {"products": []}),
6564
("/admin/subscription.setSeats", {"status": "complete"}),
66-
("/admin/subscription.getBillingLink", {"stripeLink": "https://stripe.test"}),
67-
("/admin/subscription.cancel", {"cancelAtDate": "2026-01-01"}),
6865
("/admin/accounts.getAll", {"accounts": [], "pendingConnectionSessions": []}),
6966
("/admin/accounts.disconnect", None),
7067
("/admin/accounts.reparseAccountInfo", {"workflowId": "workflow-1"}),
@@ -94,12 +91,9 @@ def test_admin_methods_use_node_paths(requests_mock: requests_mock.Mocker) -> No
9491

9592
admin.subscription.get_status()
9693
admin.subscription.get_seats()
97-
admin.subscription.get_pricing()
9894
admin.subscription.set_seats(
9995
SetSeatsParams(quantity=1, seat_type="core", billing_period="month")
10096
)
101-
admin.subscription.get_billing_link()
102-
admin.subscription.cancel()
10397
admin.accounts.get_all()
10498
admin.accounts.disconnect(DisconnectParams(account_id="a1"))
10599
admin.accounts.reparse_account_info(ReparseAccountInfoParams(account_id="a1"))

0 commit comments

Comments
 (0)