Skip to content

Commit 09ea286

Browse files
committed
Remove change repository plan API endpoint and related models
- Deleted the `change_repository_plan.py` file, which included the implementation for upgrading or downgrading shared repository subscription plans. - Updated the `get_graph_subscription.py` file to reflect changes in the subscription retrieval documentation, clarifying that it now handles both graph and shared repository subscriptions. - Enhanced the `GraphSubscriptionResponse` model by adding an `operation_id` field for tracking asynchronous tier changes. These changes streamline the API by removing unused functionality and improving the clarity of existing endpoints.
1 parent e3bceb7 commit 09ea286

3 files changed

Lines changed: 80 additions & 36 deletions

File tree

robosystems_client/api/subscriptions/change_repository_plan.py renamed to robosystems_client/api/subscriptions/change_subscription_plan.py

Lines changed: 56 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -78,23 +78,29 @@ def sync_detailed(
7878
client: AuthenticatedClient,
7979
body: UpgradeSubscriptionRequest,
8080
) -> Response[Any | GraphSubscriptionResponse | HTTPValidationError]:
81-
"""Change Repository Plan
81+
"""Change Subscription Plan
8282
83-
Upgrade or downgrade a shared repository subscription plan.
83+
Change the plan on an existing subscription.
8484
85-
Changes the plan on an existing subscription (e.g., SEC starter -> advanced).
86-
Stripe handles proration automatically.
85+
**For shared repositories** (sec, industry, etc.): Changes access tier (e.g., starter -> advanced).
86+
Synchronous — takes effect immediately.
8787
88-
**Only for shared repositories** - graph subscriptions do not support plan changes
89-
(cancel and re-subscribe instead).
88+
**For user graphs** (kg*): Changes infrastructure tier (e.g., ladybug-standard -> ladybug-large).
89+
Asynchronous — returns an `operation_id` for tracking the EBS volume migration via SSE.
90+
91+
Stripe handles proration automatically for both types.
9092
9193
**Requirements:**
9294
- User must be an OWNER of their organization
9395
- Subscription must be active
94-
- New plan must exist in the repository's manifest
96+
- New plan must be valid for the resource type
97+
98+
**Downgrade restrictions (graphs only):**
99+
- Subgraph count must fit the target tier's limit
100+
- Storage usage must fit the target tier's limit
95101
96102
Args:
97-
graph_id (str): Repository name (e.g., 'sec')
103+
graph_id (str): Graph ID or repository name
98104
body (UpgradeSubscriptionRequest): Request to upgrade a subscription.
99105
100106
Raises:
@@ -123,23 +129,29 @@ def sync(
123129
client: AuthenticatedClient,
124130
body: UpgradeSubscriptionRequest,
125131
) -> Any | GraphSubscriptionResponse | HTTPValidationError | None:
126-
"""Change Repository Plan
132+
"""Change Subscription Plan
127133
128-
Upgrade or downgrade a shared repository subscription plan.
134+
Change the plan on an existing subscription.
129135
130-
Changes the plan on an existing subscription (e.g., SEC starter -> advanced).
131-
Stripe handles proration automatically.
136+
**For shared repositories** (sec, industry, etc.): Changes access tier (e.g., starter -> advanced).
137+
Synchronous — takes effect immediately.
132138
133-
**Only for shared repositories** - graph subscriptions do not support plan changes
134-
(cancel and re-subscribe instead).
139+
**For user graphs** (kg*): Changes infrastructure tier (e.g., ladybug-standard -> ladybug-large).
140+
Asynchronous — returns an `operation_id` for tracking the EBS volume migration via SSE.
141+
142+
Stripe handles proration automatically for both types.
135143
136144
**Requirements:**
137145
- User must be an OWNER of their organization
138146
- Subscription must be active
139-
- New plan must exist in the repository's manifest
147+
- New plan must be valid for the resource type
148+
149+
**Downgrade restrictions (graphs only):**
150+
- Subgraph count must fit the target tier's limit
151+
- Storage usage must fit the target tier's limit
140152
141153
Args:
142-
graph_id (str): Repository name (e.g., 'sec')
154+
graph_id (str): Graph ID or repository name
143155
body (UpgradeSubscriptionRequest): Request to upgrade a subscription.
144156
145157
Raises:
@@ -163,23 +175,29 @@ async def asyncio_detailed(
163175
client: AuthenticatedClient,
164176
body: UpgradeSubscriptionRequest,
165177
) -> Response[Any | GraphSubscriptionResponse | HTTPValidationError]:
166-
"""Change Repository Plan
178+
"""Change Subscription Plan
167179
168-
Upgrade or downgrade a shared repository subscription plan.
180+
Change the plan on an existing subscription.
169181
170-
Changes the plan on an existing subscription (e.g., SEC starter -> advanced).
171-
Stripe handles proration automatically.
182+
**For shared repositories** (sec, industry, etc.): Changes access tier (e.g., starter -> advanced).
183+
Synchronous — takes effect immediately.
172184
173-
**Only for shared repositories** - graph subscriptions do not support plan changes
174-
(cancel and re-subscribe instead).
185+
**For user graphs** (kg*): Changes infrastructure tier (e.g., ladybug-standard -> ladybug-large).
186+
Asynchronous — returns an `operation_id` for tracking the EBS volume migration via SSE.
187+
188+
Stripe handles proration automatically for both types.
175189
176190
**Requirements:**
177191
- User must be an OWNER of their organization
178192
- Subscription must be active
179-
- New plan must exist in the repository's manifest
193+
- New plan must be valid for the resource type
194+
195+
**Downgrade restrictions (graphs only):**
196+
- Subgraph count must fit the target tier's limit
197+
- Storage usage must fit the target tier's limit
180198
181199
Args:
182-
graph_id (str): Repository name (e.g., 'sec')
200+
graph_id (str): Graph ID or repository name
183201
body (UpgradeSubscriptionRequest): Request to upgrade a subscription.
184202
185203
Raises:
@@ -206,23 +224,29 @@ async def asyncio(
206224
client: AuthenticatedClient,
207225
body: UpgradeSubscriptionRequest,
208226
) -> Any | GraphSubscriptionResponse | HTTPValidationError | None:
209-
"""Change Repository Plan
227+
"""Change Subscription Plan
210228
211-
Upgrade or downgrade a shared repository subscription plan.
229+
Change the plan on an existing subscription.
212230
213-
Changes the plan on an existing subscription (e.g., SEC starter -> advanced).
214-
Stripe handles proration automatically.
231+
**For shared repositories** (sec, industry, etc.): Changes access tier (e.g., starter -> advanced).
232+
Synchronous — takes effect immediately.
215233
216-
**Only for shared repositories** - graph subscriptions do not support plan changes
217-
(cancel and re-subscribe instead).
234+
**For user graphs** (kg*): Changes infrastructure tier (e.g., ladybug-standard -> ladybug-large).
235+
Asynchronous — returns an `operation_id` for tracking the EBS volume migration via SSE.
236+
237+
Stripe handles proration automatically for both types.
218238
219239
**Requirements:**
220240
- User must be an OWNER of their organization
221241
- Subscription must be active
222-
- New plan must exist in the repository's manifest
242+
- New plan must be valid for the resource type
243+
244+
**Downgrade restrictions (graphs only):**
245+
- Subgraph count must fit the target tier's limit
246+
- Storage usage must fit the target tier's limit
223247
224248
Args:
225-
graph_id (str): Repository name (e.g., 'sec')
249+
graph_id (str): Graph ID or repository name
226250
body (UpgradeSubscriptionRequest): Request to upgrade a subscription.
227251
228252
Raises:

‎robosystems_client/api/subscriptions/get_graph_subscription.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def sync_detailed(
6363
*,
6464
client: AuthenticatedClient,
6565
) -> Response[Any | GraphSubscriptionResponse | HTTPValidationError]:
66-
"""Get Subscription
66+
"""Get Graph and Shared Repository Subscription
6767
6868
Get subscription details for a graph or shared repository.
6969
@@ -101,7 +101,7 @@ def sync(
101101
*,
102102
client: AuthenticatedClient,
103103
) -> Any | GraphSubscriptionResponse | HTTPValidationError | None:
104-
"""Get Subscription
104+
"""Get Graph and Shared Repository Subscription
105105
106106
Get subscription details for a graph or shared repository.
107107
@@ -134,7 +134,7 @@ async def asyncio_detailed(
134134
*,
135135
client: AuthenticatedClient,
136136
) -> Response[Any | GraphSubscriptionResponse | HTTPValidationError]:
137-
"""Get Subscription
137+
"""Get Graph and Shared Repository Subscription
138138
139139
Get subscription details for a graph or shared repository.
140140
@@ -170,7 +170,7 @@ async def asyncio(
170170
*,
171171
client: AuthenticatedClient,
172172
) -> Any | GraphSubscriptionResponse | HTTPValidationError | None:
173-
"""Get Subscription
173+
"""Get Graph and Shared Repository Subscription
174174
175175
Get subscription details for a graph or shared repository.
176176

‎robosystems_client/models/graph_subscription_response.py‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class GraphSubscriptionResponse:
3131
canceled_at (None | str | Unset): Cancellation date
3232
ends_at (None | str | Unset): Subscription end date (when access will be revoked, especially relevant for
3333
cancelled subscriptions)
34+
operation_id (None | str | Unset): Operation ID for tracking async tier changes via SSE
3435
"""
3536

3637
id: str
@@ -47,6 +48,7 @@ class GraphSubscriptionResponse:
4748
started_at: None | str | Unset = UNSET
4849
canceled_at: None | str | Unset = UNSET
4950
ends_at: None | str | Unset = UNSET
51+
operation_id: None | str | Unset = UNSET
5052
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
5153

5254
def to_dict(self) -> dict[str, Any]:
@@ -98,6 +100,12 @@ def to_dict(self) -> dict[str, Any]:
98100
else:
99101
ends_at = self.ends_at
100102

103+
operation_id: None | str | Unset
104+
if isinstance(self.operation_id, Unset):
105+
operation_id = UNSET
106+
else:
107+
operation_id = self.operation_id
108+
101109
field_dict: dict[str, Any] = {}
102110
field_dict.update(self.additional_properties)
103111
field_dict.update(
@@ -123,6 +131,8 @@ def to_dict(self) -> dict[str, Any]:
123131
field_dict["canceled_at"] = canceled_at
124132
if ends_at is not UNSET:
125133
field_dict["ends_at"] = ends_at
134+
if operation_id is not UNSET:
135+
field_dict["operation_id"] = operation_id
126136

127137
return field_dict
128138

@@ -194,6 +204,15 @@ def _parse_ends_at(data: object) -> None | str | Unset:
194204

195205
ends_at = _parse_ends_at(d.pop("ends_at", UNSET))
196206

207+
def _parse_operation_id(data: object) -> None | str | Unset:
208+
if data is None:
209+
return data
210+
if isinstance(data, Unset):
211+
return data
212+
return cast(None | str | Unset, data)
213+
214+
operation_id = _parse_operation_id(d.pop("operation_id", UNSET))
215+
197216
graph_subscription_response = cls(
198217
id=id,
199218
resource_type=resource_type,
@@ -209,6 +228,7 @@ def _parse_ends_at(data: object) -> None | str | Unset:
209228
started_at=started_at,
210229
canceled_at=canceled_at,
211230
ends_at=ends_at,
231+
operation_id=operation_id,
212232
)
213233

214234
graph_subscription_response.additional_properties = d

0 commit comments

Comments
 (0)