Skip to content

Commit 1140bf2

Browse files
committed
Remove deprecated billing and subscription API files, including update payment method and cancel subscription functionalities. Update subgraph creation documentation to reflect new tier requirements for subgraphs. Enhance delete subgraph documentation with specific backup location details.
1 parent 0722771 commit 1140bf2

11 files changed

Lines changed: 118 additions & 446 deletions

robosystems_client/api/billing/update_org_payment_method.py renamed to robosystems_client/api/billing/create_portal_session.py

Lines changed: 57 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,26 @@
66
from ... import errors
77
from ...client import AuthenticatedClient, Client
88
from ...models.http_validation_error import HTTPValidationError
9-
from ...models.update_payment_method_request import UpdatePaymentMethodRequest
10-
from ...models.update_payment_method_response import UpdatePaymentMethodResponse
9+
from ...models.portal_session_response import PortalSessionResponse
1110
from ...types import Response
1211

1312

1413
def _get_kwargs(
1514
org_id: str,
16-
*,
17-
body: UpdatePaymentMethodRequest,
1815
) -> dict[str, Any]:
19-
headers: dict[str, Any] = {}
20-
2116
_kwargs: dict[str, Any] = {
2217
"method": "post",
23-
"url": f"/v1/billing/customer/{org_id}/payment-method",
18+
"url": f"/v1/billing/customer/{org_id}/portal",
2419
}
2520

26-
_kwargs["json"] = body.to_dict()
27-
28-
headers["Content-Type"] = "application/json"
29-
30-
_kwargs["headers"] = headers
3121
return _kwargs
3222

3323

3424
def _parse_response(
3525
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
36-
) -> Optional[Union[HTTPValidationError, UpdatePaymentMethodResponse]]:
26+
) -> Optional[Union[HTTPValidationError, PortalSessionResponse]]:
3727
if response.status_code == 200:
38-
response_200 = UpdatePaymentMethodResponse.from_dict(response.json())
28+
response_200 = PortalSessionResponse.from_dict(response.json())
3929

4030
return response_200
4131

@@ -52,7 +42,7 @@ def _parse_response(
5242

5343
def _build_response(
5444
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
55-
) -> Response[Union[HTTPValidationError, UpdatePaymentMethodResponse]]:
45+
) -> Response[Union[HTTPValidationError, PortalSessionResponse]]:
5646
return Response(
5747
status_code=HTTPStatus(response.status_code),
5848
content=response.content,
@@ -65,32 +55,37 @@ def sync_detailed(
6555
org_id: str,
6656
*,
6757
client: AuthenticatedClient,
68-
body: UpdatePaymentMethodRequest,
69-
) -> Response[Union[HTTPValidationError, UpdatePaymentMethodResponse]]:
70-
"""Update Organization Default Payment Method
58+
) -> Response[Union[HTTPValidationError, PortalSessionResponse]]:
59+
"""Create Customer Portal Session
7160
72-
Update the default payment method for the organization.
61+
Create a Stripe Customer Portal session for managing payment methods.
7362
74-
This changes which payment method will be used for future subscription charges.
63+
The portal allows users to:
64+
- Add new payment methods
65+
- Remove existing payment methods
66+
- Update default payment method
67+
- View billing history
68+
69+
The user will be redirected to Stripe's hosted portal page and returned to the billing page when
70+
done.
7571
7672
**Requirements:**
7773
- User must be an OWNER of the organization
74+
- Organization must have a Stripe customer ID (i.e., has gone through checkout at least once)
7875
7976
Args:
8077
org_id (str):
81-
body (UpdatePaymentMethodRequest): Request to update default payment method.
8278
8379
Raises:
8480
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
8581
httpx.TimeoutException: If the request takes longer than Client.timeout.
8682
8783
Returns:
88-
Response[Union[HTTPValidationError, UpdatePaymentMethodResponse]]
84+
Response[Union[HTTPValidationError, PortalSessionResponse]]
8985
"""
9086

9187
kwargs = _get_kwargs(
9288
org_id=org_id,
93-
body=body,
9489
)
9590

9691
response = client.get_httpx_client().request(
@@ -104,66 +99,76 @@ def sync(
10499
org_id: str,
105100
*,
106101
client: AuthenticatedClient,
107-
body: UpdatePaymentMethodRequest,
108-
) -> Optional[Union[HTTPValidationError, UpdatePaymentMethodResponse]]:
109-
"""Update Organization Default Payment Method
102+
) -> Optional[Union[HTTPValidationError, PortalSessionResponse]]:
103+
"""Create Customer Portal Session
104+
105+
Create a Stripe Customer Portal session for managing payment methods.
110106
111-
Update the default payment method for the organization.
107+
The portal allows users to:
108+
- Add new payment methods
109+
- Remove existing payment methods
110+
- Update default payment method
111+
- View billing history
112112
113-
This changes which payment method will be used for future subscription charges.
113+
The user will be redirected to Stripe's hosted portal page and returned to the billing page when
114+
done.
114115
115116
**Requirements:**
116117
- User must be an OWNER of the organization
118+
- Organization must have a Stripe customer ID (i.e., has gone through checkout at least once)
117119
118120
Args:
119121
org_id (str):
120-
body (UpdatePaymentMethodRequest): Request to update default payment method.
121122
122123
Raises:
123124
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
124125
httpx.TimeoutException: If the request takes longer than Client.timeout.
125126
126127
Returns:
127-
Union[HTTPValidationError, UpdatePaymentMethodResponse]
128+
Union[HTTPValidationError, PortalSessionResponse]
128129
"""
129130

130131
return sync_detailed(
131132
org_id=org_id,
132133
client=client,
133-
body=body,
134134
).parsed
135135

136136

137137
async def asyncio_detailed(
138138
org_id: str,
139139
*,
140140
client: AuthenticatedClient,
141-
body: UpdatePaymentMethodRequest,
142-
) -> Response[Union[HTTPValidationError, UpdatePaymentMethodResponse]]:
143-
"""Update Organization Default Payment Method
141+
) -> Response[Union[HTTPValidationError, PortalSessionResponse]]:
142+
"""Create Customer Portal Session
144143
145-
Update the default payment method for the organization.
144+
Create a Stripe Customer Portal session for managing payment methods.
146145
147-
This changes which payment method will be used for future subscription charges.
146+
The portal allows users to:
147+
- Add new payment methods
148+
- Remove existing payment methods
149+
- Update default payment method
150+
- View billing history
151+
152+
The user will be redirected to Stripe's hosted portal page and returned to the billing page when
153+
done.
148154
149155
**Requirements:**
150156
- User must be an OWNER of the organization
157+
- Organization must have a Stripe customer ID (i.e., has gone through checkout at least once)
151158
152159
Args:
153160
org_id (str):
154-
body (UpdatePaymentMethodRequest): Request to update default payment method.
155161
156162
Raises:
157163
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
158164
httpx.TimeoutException: If the request takes longer than Client.timeout.
159165
160166
Returns:
161-
Response[Union[HTTPValidationError, UpdatePaymentMethodResponse]]
167+
Response[Union[HTTPValidationError, PortalSessionResponse]]
162168
"""
163169

164170
kwargs = _get_kwargs(
165171
org_id=org_id,
166-
body=body,
167172
)
168173

169174
response = await client.get_async_httpx_client().request(**kwargs)
@@ -175,33 +180,38 @@ async def asyncio(
175180
org_id: str,
176181
*,
177182
client: AuthenticatedClient,
178-
body: UpdatePaymentMethodRequest,
179-
) -> Optional[Union[HTTPValidationError, UpdatePaymentMethodResponse]]:
180-
"""Update Organization Default Payment Method
183+
) -> Optional[Union[HTTPValidationError, PortalSessionResponse]]:
184+
"""Create Customer Portal Session
185+
186+
Create a Stripe Customer Portal session for managing payment methods.
181187
182-
Update the default payment method for the organization.
188+
The portal allows users to:
189+
- Add new payment methods
190+
- Remove existing payment methods
191+
- Update default payment method
192+
- View billing history
183193
184-
This changes which payment method will be used for future subscription charges.
194+
The user will be redirected to Stripe's hosted portal page and returned to the billing page when
195+
done.
185196
186197
**Requirements:**
187198
- User must be an OWNER of the organization
199+
- Organization must have a Stripe customer ID (i.e., has gone through checkout at least once)
188200
189201
Args:
190202
org_id (str):
191-
body (UpdatePaymentMethodRequest): Request to update default payment method.
192203
193204
Raises:
194205
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
195206
httpx.TimeoutException: If the request takes longer than Client.timeout.
196207
197208
Returns:
198-
Union[HTTPValidationError, UpdatePaymentMethodResponse]
209+
Union[HTTPValidationError, PortalSessionResponse]
199210
"""
200211

201212
return (
202213
await asyncio_detailed(
203214
org_id=org_id,
204215
client=client,
205-
body=body,
206216
)
207217
).parsed

‎robosystems_client/api/subgraphs/create_subgraph.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def sync_detailed(
7575
- Valid authentication
7676
- Parent graph must exist and be accessible to the user
7777
- User must have 'admin' permission on the parent graph
78-
- Parent graph tier must support subgraphs (Enterprise or Premium only)
78+
- Parent graph tier must support subgraphs (Kuzu Large/XLarge or Neo4j Enterprise XLarge)
7979
- Must be within subgraph quota limits
8080
- Subgraph name must be unique within the parent graph
8181
@@ -120,7 +120,7 @@ def sync(
120120
- Valid authentication
121121
- Parent graph must exist and be accessible to the user
122122
- User must have 'admin' permission on the parent graph
123-
- Parent graph tier must support subgraphs (Enterprise or Premium only)
123+
- Parent graph tier must support subgraphs (Kuzu Large/XLarge or Neo4j Enterprise XLarge)
124124
- Must be within subgraph quota limits
125125
- Subgraph name must be unique within the parent graph
126126
@@ -160,7 +160,7 @@ async def asyncio_detailed(
160160
- Valid authentication
161161
- Parent graph must exist and be accessible to the user
162162
- User must have 'admin' permission on the parent graph
163-
- Parent graph tier must support subgraphs (Enterprise or Premium only)
163+
- Parent graph tier must support subgraphs (Kuzu Large/XLarge or Neo4j Enterprise XLarge)
164164
- Must be within subgraph quota limits
165165
- Subgraph name must be unique within the parent graph
166166
@@ -203,7 +203,7 @@ async def asyncio(
203203
- Valid authentication
204204
- Parent graph must exist and be accessible to the user
205205
- User must have 'admin' permission on the parent graph
206-
- Parent graph tier must support subgraphs (Enterprise or Premium only)
206+
- Parent graph tier must support subgraphs (Kuzu Large/XLarge or Neo4j Enterprise XLarge)
207207
- Must be within subgraph quota limits
208208
- Subgraph name must be unique within the parent graph
209209

‎robosystems_client/api/subgraphs/delete_subgraph.py‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ def sync_detailed(
111111
All data in the subgraph will be lost.
112112
113113
**Backup Location:**
114-
If backup requested, stored in S3 at:
115-
`s3://robosystems-backups/{instance_id}/{database_name}_{timestamp}.backup`
114+
If backup requested, stored in S3 Kuzu database bucket at:
115+
`s3://{kuzu_s3_bucket}/{instance_id}/{database_name}_{timestamp}.backup`
116116
117117
Args:
118118
graph_id (str):
@@ -165,8 +165,8 @@ def sync(
165165
All data in the subgraph will be lost.
166166
167167
**Backup Location:**
168-
If backup requested, stored in S3 at:
169-
`s3://robosystems-backups/{instance_id}/{database_name}_{timestamp}.backup`
168+
If backup requested, stored in S3 Kuzu database bucket at:
169+
`s3://{kuzu_s3_bucket}/{instance_id}/{database_name}_{timestamp}.backup`
170170
171171
Args:
172172
graph_id (str):
@@ -214,8 +214,8 @@ async def asyncio_detailed(
214214
All data in the subgraph will be lost.
215215
216216
**Backup Location:**
217-
If backup requested, stored in S3 at:
218-
`s3://robosystems-backups/{instance_id}/{database_name}_{timestamp}.backup`
217+
If backup requested, stored in S3 Kuzu database bucket at:
218+
`s3://{kuzu_s3_bucket}/{instance_id}/{database_name}_{timestamp}.backup`
219219
220220
Args:
221221
graph_id (str):
@@ -266,8 +266,8 @@ async def asyncio(
266266
All data in the subgraph will be lost.
267267
268268
**Backup Location:**
269-
If backup requested, stored in S3 at:
270-
`s3://robosystems-backups/{instance_id}/{database_name}_{timestamp}.backup`
269+
If backup requested, stored in S3 Kuzu database bucket at:
270+
`s3://{kuzu_s3_bucket}/{instance_id}/{database_name}_{timestamp}.backup`
271271
272272
Args:
273273
graph_id (str):

0 commit comments

Comments
 (0)