robosystems-client 0.2.9__py3-none-any.whl → 0.2.11__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. robosystems_client/api/{user_subscriptions/upgrade_shared_repository_subscription.py → billing/cancel_subscription.py} +32 -60
  2. robosystems_client/api/billing/create_checkout_session.py +230 -0
  3. robosystems_client/api/{user_analytics/get_user_usage_overview.py → billing/get_billing_customer.py} +29 -21
  4. robosystems_client/api/billing/get_checkout_status.py +221 -0
  5. robosystems_client/api/{user_subscriptions/get_repository_credits.py → billing/get_subscription.py} +35 -43
  6. robosystems_client/api/{user_subscriptions/get_shared_repository_credits.py → billing/get_upcoming_invoice.py} +42 -28
  7. robosystems_client/api/{user_subscriptions/get_user_shared_subscriptions.py → billing/list_invoices.py} +44 -44
  8. robosystems_client/api/{user_limits/get_all_shared_repository_limits.py → billing/list_subscriptions.py} +38 -27
  9. robosystems_client/api/{user_subscriptions/subscribe_to_shared_repository.py → billing/update_payment_method.py} +42 -46
  10. robosystems_client/api/{user_subscriptions/cancel_shared_repository_subscription.py → subscriptions/cancel_subscription.py} +41 -25
  11. robosystems_client/api/subscriptions/create_repository_subscription.py +217 -0
  12. robosystems_client/api/subscriptions/get_graph_subscription.py +197 -0
  13. robosystems_client/api/subscriptions/upgrade_subscription.py +203 -0
  14. robosystems_client/api/usage/get_graph_usage_analytics.py +377 -0
  15. robosystems_client/api/{user_limits/get_user_usage.py → user/get_user_limits.py} +13 -9
  16. robosystems_client/models/__init__.py +42 -82
  17. robosystems_client/models/billing_customer.py +128 -0
  18. robosystems_client/models/checkout_response.py +87 -0
  19. robosystems_client/models/checkout_status_response.py +130 -0
  20. robosystems_client/models/create_checkout_request.py +88 -0
  21. robosystems_client/models/{graph_usage_response_query_statistics.py → create_checkout_request_resource_config.py} +6 -6
  22. robosystems_client/models/{credits_summary_response_credits_by_addon_type_0_item.py → create_repository_subscription_request.py} +22 -6
  23. robosystems_client/models/credit_summary.py +55 -89
  24. robosystems_client/models/{graph_usage_response_storage_usage.py → credit_summary_operation_breakdown.py} +6 -6
  25. robosystems_client/models/graph_subscription_response.py +200 -0
  26. robosystems_client/models/graph_usage_response.py +136 -39
  27. robosystems_client/models/{user_analytics_response_limits.py → graph_usage_response_recent_events_item.py} +6 -6
  28. robosystems_client/models/invoice.py +244 -0
  29. robosystems_client/models/invoice_line_item.py +118 -0
  30. robosystems_client/models/invoices_response.py +90 -0
  31. robosystems_client/models/payment_method.py +158 -0
  32. robosystems_client/models/performance_insights.py +120 -0
  33. robosystems_client/models/{graph_usage_response_recent_activity.py → performance_insights_operation_stats.py} +6 -6
  34. robosystems_client/models/{user_analytics_response_api_usage.py → performance_insights_slow_queries_item.py} +6 -6
  35. robosystems_client/models/storage_summary.py +100 -0
  36. robosystems_client/models/upcoming_invoice.py +128 -0
  37. robosystems_client/models/{get_graph_usage_details_response_getgraphusagedetails.py → update_payment_method_request.py} +22 -6
  38. robosystems_client/models/{subscription_response.py → update_payment_method_response.py} +14 -14
  39. robosystems_client/models/{tier_upgrade_request.py → upgrade_subscription_request.py} +12 -14
  40. {robosystems_client-0.2.9.dist-info → robosystems_client-0.2.11.dist-info}/METADATA +1 -1
  41. {robosystems_client-0.2.9.dist-info → robosystems_client-0.2.11.dist-info}/RECORD +53 -68
  42. robosystems_client/api/graph_analytics/get_graph_usage_stats.py +0 -289
  43. robosystems_client/api/graph_billing/get_current_graph_bill.py +0 -253
  44. robosystems_client/api/graph_billing/get_graph_billing_history.py +0 -298
  45. robosystems_client/api/graph_billing/get_graph_monthly_bill.py +0 -284
  46. robosystems_client/api/graph_billing/get_graph_usage_details.py +0 -320
  47. robosystems_client/api/user/get_all_credit_summaries.py +0 -169
  48. robosystems_client/api/user_analytics/get_detailed_user_analytics.py +0 -188
  49. robosystems_client/api/user_limits/__init__.py +0 -1
  50. robosystems_client/api/user_limits/get_shared_repository_limits.py +0 -213
  51. robosystems_client/api/user_limits/get_user_limits.py +0 -139
  52. robosystems_client/api/user_subscriptions/__init__.py +0 -1
  53. robosystems_client/models/add_on_credit_info.py +0 -119
  54. robosystems_client/models/credits_summary_response.py +0 -148
  55. robosystems_client/models/get_all_credit_summaries_response_getallcreditsummaries.py +0 -44
  56. robosystems_client/models/get_all_shared_repository_limits_response_getallsharedrepositorylimits.py +0 -46
  57. robosystems_client/models/get_current_graph_bill_response_getcurrentgraphbill.py +0 -44
  58. robosystems_client/models/get_graph_billing_history_response_getgraphbillinghistory.py +0 -44
  59. robosystems_client/models/get_graph_monthly_bill_response_getgraphmonthlybill.py +0 -44
  60. robosystems_client/models/get_shared_repository_limits_response_getsharedrepositorylimits.py +0 -44
  61. robosystems_client/models/repository_credits_response.py +0 -128
  62. robosystems_client/models/repository_plan.py +0 -10
  63. robosystems_client/models/repository_type.py +0 -10
  64. robosystems_client/models/subscription_info.py +0 -152
  65. robosystems_client/models/subscription_info_metadata.py +0 -44
  66. robosystems_client/models/subscription_request.py +0 -80
  67. robosystems_client/models/user_analytics_response.py +0 -132
  68. robosystems_client/models/user_analytics_response_graph_usage.py +0 -44
  69. robosystems_client/models/user_analytics_response_recent_activity_item.py +0 -44
  70. robosystems_client/models/user_analytics_response_user_info.py +0 -44
  71. robosystems_client/models/user_graph_summary.py +0 -134
  72. robosystems_client/models/user_subscriptions_response.py +0 -90
  73. robosystems_client/models/user_usage_summary_response.py +0 -130
  74. robosystems_client/models/user_usage_summary_response_usage_vs_limits.py +0 -44
  75. /robosystems_client/api/{graph_analytics → billing}/__init__.py +0 -0
  76. /robosystems_client/api/{graph_billing → credits_}/__init__.py +0 -0
  77. /robosystems_client/api/{graph_credits → credits_}/check_credit_balance.py +0 -0
  78. /robosystems_client/api/{graph_credits → credits_}/check_storage_limits.py +0 -0
  79. /robosystems_client/api/{graph_credits → credits_}/get_credit_summary.py +0 -0
  80. /robosystems_client/api/{graph_credits → credits_}/get_storage_usage.py +0 -0
  81. /robosystems_client/api/{graph_credits → credits_}/list_credit_transactions.py +0 -0
  82. /robosystems_client/api/{graph_credits → subscriptions}/__init__.py +0 -0
  83. /robosystems_client/api/{user_analytics → usage}/__init__.py +0 -0
  84. /robosystems_client/api/{graph_analytics → usage}/get_graph_metrics.py +0 -0
  85. {robosystems_client-0.2.9.dist-info → robosystems_client-0.2.11.dist-info}/WHEEL +0 -0
  86. {robosystems_client-0.2.9.dist-info → robosystems_client-0.2.11.dist-info}/licenses/LICENSE +0 -0
@@ -1,63 +1,39 @@
1
1
  from http import HTTPStatus
2
- from typing import Any, Optional, Union, cast
2
+ from typing import Any, Optional, Union
3
3
 
4
4
  import httpx
5
5
 
6
6
  from ... import errors
7
7
  from ...client import AuthenticatedClient, Client
8
+ from ...models.graph_subscription_response import GraphSubscriptionResponse
8
9
  from ...models.http_validation_error import HTTPValidationError
9
- from ...models.tier_upgrade_request import TierUpgradeRequest
10
10
  from ...types import Response
11
11
 
12
12
 
13
13
  def _get_kwargs(
14
14
  subscription_id: str,
15
- *,
16
- body: TierUpgradeRequest,
17
15
  ) -> dict[str, Any]:
18
- headers: dict[str, Any] = {}
19
-
20
16
  _kwargs: dict[str, Any] = {
21
- "method": "put",
22
- "url": f"/v1/user/subscriptions/shared-repositories/{subscription_id}/upgrade",
17
+ "method": "post",
18
+ "url": f"/v1/billing/subscriptions/{subscription_id}/cancel",
23
19
  }
24
20
 
25
- _kwargs["json"] = body.to_dict()
26
-
27
- headers["Content-Type"] = "application/json"
28
-
29
- _kwargs["headers"] = headers
30
21
  return _kwargs
31
22
 
32
23
 
33
24
  def _parse_response(
34
25
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
35
- ) -> Optional[Union[Any, HTTPValidationError]]:
26
+ ) -> Optional[Union[GraphSubscriptionResponse, HTTPValidationError]]:
36
27
  if response.status_code == 200:
37
- response_200 = response.json()
38
- return response_200
39
-
40
- if response.status_code == 400:
41
- response_400 = cast(Any, None)
42
- return response_400
43
-
44
- if response.status_code == 401:
45
- response_401 = cast(Any, None)
46
- return response_401
28
+ response_200 = GraphSubscriptionResponse.from_dict(response.json())
47
29
 
48
- if response.status_code == 404:
49
- response_404 = cast(Any, None)
50
- return response_404
30
+ return response_200
51
31
 
52
32
  if response.status_code == 422:
53
33
  response_422 = HTTPValidationError.from_dict(response.json())
54
34
 
55
35
  return response_422
56
36
 
57
- if response.status_code == 500:
58
- response_500 = cast(Any, None)
59
- return response_500
60
-
61
37
  if client.raise_on_unexpected_status:
62
38
  raise errors.UnexpectedStatus(response.status_code, response.content)
63
39
  else:
@@ -66,7 +42,7 @@ def _parse_response(
66
42
 
67
43
  def _build_response(
68
44
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
69
- ) -> Response[Union[Any, HTTPValidationError]]:
45
+ ) -> Response[Union[GraphSubscriptionResponse, HTTPValidationError]]:
70
46
  return Response(
71
47
  status_code=HTTPStatus(response.status_code),
72
48
  content=response.content,
@@ -79,27 +55,26 @@ def sync_detailed(
79
55
  subscription_id: str,
80
56
  *,
81
57
  client: AuthenticatedClient,
82
- body: TierUpgradeRequest,
83
- ) -> Response[Union[Any, HTTPValidationError]]:
84
- """Upgrade Subscription Tier
58
+ ) -> Response[Union[GraphSubscriptionResponse, HTTPValidationError]]:
59
+ """Cancel Subscription
60
+
61
+ Cancel a subscription.
85
62
 
86
- Upgrade a subscription to a higher tier with immediate credit adjustment
63
+ The subscription will remain active until the end of the current billing period.
87
64
 
88
65
  Args:
89
66
  subscription_id (str):
90
- body (TierUpgradeRequest): Request to upgrade subscription tier.
91
67
 
92
68
  Raises:
93
69
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
94
70
  httpx.TimeoutException: If the request takes longer than Client.timeout.
95
71
 
96
72
  Returns:
97
- Response[Union[Any, HTTPValidationError]]
73
+ Response[Union[GraphSubscriptionResponse, HTTPValidationError]]
98
74
  """
99
75
 
100
76
  kwargs = _get_kwargs(
101
77
  subscription_id=subscription_id,
102
- body=body,
103
78
  )
104
79
 
105
80
  response = client.get_httpx_client().request(
@@ -113,28 +88,27 @@ def sync(
113
88
  subscription_id: str,
114
89
  *,
115
90
  client: AuthenticatedClient,
116
- body: TierUpgradeRequest,
117
- ) -> Optional[Union[Any, HTTPValidationError]]:
118
- """Upgrade Subscription Tier
91
+ ) -> Optional[Union[GraphSubscriptionResponse, HTTPValidationError]]:
92
+ """Cancel Subscription
119
93
 
120
- Upgrade a subscription to a higher tier with immediate credit adjustment
94
+ Cancel a subscription.
95
+
96
+ The subscription will remain active until the end of the current billing period.
121
97
 
122
98
  Args:
123
99
  subscription_id (str):
124
- body (TierUpgradeRequest): Request to upgrade subscription tier.
125
100
 
126
101
  Raises:
127
102
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
128
103
  httpx.TimeoutException: If the request takes longer than Client.timeout.
129
104
 
130
105
  Returns:
131
- Union[Any, HTTPValidationError]
106
+ Union[GraphSubscriptionResponse, HTTPValidationError]
132
107
  """
133
108
 
134
109
  return sync_detailed(
135
110
  subscription_id=subscription_id,
136
111
  client=client,
137
- body=body,
138
112
  ).parsed
139
113
 
140
114
 
@@ -142,27 +116,26 @@ async def asyncio_detailed(
142
116
  subscription_id: str,
143
117
  *,
144
118
  client: AuthenticatedClient,
145
- body: TierUpgradeRequest,
146
- ) -> Response[Union[Any, HTTPValidationError]]:
147
- """Upgrade Subscription Tier
119
+ ) -> Response[Union[GraphSubscriptionResponse, HTTPValidationError]]:
120
+ """Cancel Subscription
121
+
122
+ Cancel a subscription.
148
123
 
149
- Upgrade a subscription to a higher tier with immediate credit adjustment
124
+ The subscription will remain active until the end of the current billing period.
150
125
 
151
126
  Args:
152
127
  subscription_id (str):
153
- body (TierUpgradeRequest): Request to upgrade subscription tier.
154
128
 
155
129
  Raises:
156
130
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
157
131
  httpx.TimeoutException: If the request takes longer than Client.timeout.
158
132
 
159
133
  Returns:
160
- Response[Union[Any, HTTPValidationError]]
134
+ Response[Union[GraphSubscriptionResponse, HTTPValidationError]]
161
135
  """
162
136
 
163
137
  kwargs = _get_kwargs(
164
138
  subscription_id=subscription_id,
165
- body=body,
166
139
  )
167
140
 
168
141
  response = await client.get_async_httpx_client().request(**kwargs)
@@ -174,28 +147,27 @@ async def asyncio(
174
147
  subscription_id: str,
175
148
  *,
176
149
  client: AuthenticatedClient,
177
- body: TierUpgradeRequest,
178
- ) -> Optional[Union[Any, HTTPValidationError]]:
179
- """Upgrade Subscription Tier
150
+ ) -> Optional[Union[GraphSubscriptionResponse, HTTPValidationError]]:
151
+ """Cancel Subscription
152
+
153
+ Cancel a subscription.
180
154
 
181
- Upgrade a subscription to a higher tier with immediate credit adjustment
155
+ The subscription will remain active until the end of the current billing period.
182
156
 
183
157
  Args:
184
158
  subscription_id (str):
185
- body (TierUpgradeRequest): Request to upgrade subscription tier.
186
159
 
187
160
  Raises:
188
161
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
189
162
  httpx.TimeoutException: If the request takes longer than Client.timeout.
190
163
 
191
164
  Returns:
192
- Union[Any, HTTPValidationError]
165
+ Union[GraphSubscriptionResponse, HTTPValidationError]
193
166
  """
194
167
 
195
168
  return (
196
169
  await asyncio_detailed(
197
170
  subscription_id=subscription_id,
198
171
  client=client,
199
- body=body,
200
172
  )
201
173
  ).parsed
@@ -0,0 +1,230 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.checkout_response import CheckoutResponse
9
+ from ...models.create_checkout_request import CreateCheckoutRequest
10
+ from ...models.http_validation_error import HTTPValidationError
11
+ from ...types import Response
12
+
13
+
14
+ def _get_kwargs(
15
+ *,
16
+ body: CreateCheckoutRequest,
17
+ ) -> dict[str, Any]:
18
+ headers: dict[str, Any] = {}
19
+
20
+ _kwargs: dict[str, Any] = {
21
+ "method": "post",
22
+ "url": "/v1/billing/checkout",
23
+ }
24
+
25
+ _kwargs["json"] = body.to_dict()
26
+
27
+ headers["Content-Type"] = "application/json"
28
+
29
+ _kwargs["headers"] = headers
30
+ return _kwargs
31
+
32
+
33
+ def _parse_response(
34
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
35
+ ) -> Optional[Union[CheckoutResponse, HTTPValidationError]]:
36
+ if response.status_code == 201:
37
+ response_201 = CheckoutResponse.from_dict(response.json())
38
+
39
+ return response_201
40
+
41
+ if response.status_code == 422:
42
+ response_422 = HTTPValidationError.from_dict(response.json())
43
+
44
+ return response_422
45
+
46
+ if client.raise_on_unexpected_status:
47
+ raise errors.UnexpectedStatus(response.status_code, response.content)
48
+ else:
49
+ return None
50
+
51
+
52
+ def _build_response(
53
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
54
+ ) -> Response[Union[CheckoutResponse, HTTPValidationError]]:
55
+ return Response(
56
+ status_code=HTTPStatus(response.status_code),
57
+ content=response.content,
58
+ headers=response.headers,
59
+ parsed=_parse_response(client=client, response=response),
60
+ )
61
+
62
+
63
+ def sync_detailed(
64
+ *,
65
+ client: AuthenticatedClient,
66
+ body: CreateCheckoutRequest,
67
+ ) -> Response[Union[CheckoutResponse, HTTPValidationError]]:
68
+ """Create Payment Checkout Session
69
+
70
+ Create a Stripe checkout session for collecting payment method.
71
+
72
+ This endpoint is used when a user needs to add a payment method before
73
+ provisioning resources. It creates a pending subscription and redirects
74
+ the user to Stripe Checkout to collect payment details.
75
+
76
+ **Flow:**
77
+ 1. User tries to create a graph but has no payment method
78
+ 2. Frontend calls this endpoint with graph configuration
79
+ 3. Backend creates a subscription in PENDING_PAYMENT status
80
+ 4. Returns Stripe Checkout URL
81
+ 5. User completes payment on Stripe
82
+ 6. Webhook activates subscription and provisions resource
83
+
84
+ **Enterprise customers** (with invoice_billing_enabled) should not call this endpoint.
85
+
86
+ Args:
87
+ body (CreateCheckoutRequest): Request to create a checkout session for payment collection.
88
+
89
+ Raises:
90
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
91
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
92
+
93
+ Returns:
94
+ Response[Union[CheckoutResponse, HTTPValidationError]]
95
+ """
96
+
97
+ kwargs = _get_kwargs(
98
+ body=body,
99
+ )
100
+
101
+ response = client.get_httpx_client().request(
102
+ **kwargs,
103
+ )
104
+
105
+ return _build_response(client=client, response=response)
106
+
107
+
108
+ def sync(
109
+ *,
110
+ client: AuthenticatedClient,
111
+ body: CreateCheckoutRequest,
112
+ ) -> Optional[Union[CheckoutResponse, HTTPValidationError]]:
113
+ """Create Payment Checkout Session
114
+
115
+ Create a Stripe checkout session for collecting payment method.
116
+
117
+ This endpoint is used when a user needs to add a payment method before
118
+ provisioning resources. It creates a pending subscription and redirects
119
+ the user to Stripe Checkout to collect payment details.
120
+
121
+ **Flow:**
122
+ 1. User tries to create a graph but has no payment method
123
+ 2. Frontend calls this endpoint with graph configuration
124
+ 3. Backend creates a subscription in PENDING_PAYMENT status
125
+ 4. Returns Stripe Checkout URL
126
+ 5. User completes payment on Stripe
127
+ 6. Webhook activates subscription and provisions resource
128
+
129
+ **Enterprise customers** (with invoice_billing_enabled) should not call this endpoint.
130
+
131
+ Args:
132
+ body (CreateCheckoutRequest): Request to create a checkout session for payment collection.
133
+
134
+ Raises:
135
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
136
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
137
+
138
+ Returns:
139
+ Union[CheckoutResponse, HTTPValidationError]
140
+ """
141
+
142
+ return sync_detailed(
143
+ client=client,
144
+ body=body,
145
+ ).parsed
146
+
147
+
148
+ async def asyncio_detailed(
149
+ *,
150
+ client: AuthenticatedClient,
151
+ body: CreateCheckoutRequest,
152
+ ) -> Response[Union[CheckoutResponse, HTTPValidationError]]:
153
+ """Create Payment Checkout Session
154
+
155
+ Create a Stripe checkout session for collecting payment method.
156
+
157
+ This endpoint is used when a user needs to add a payment method before
158
+ provisioning resources. It creates a pending subscription and redirects
159
+ the user to Stripe Checkout to collect payment details.
160
+
161
+ **Flow:**
162
+ 1. User tries to create a graph but has no payment method
163
+ 2. Frontend calls this endpoint with graph configuration
164
+ 3. Backend creates a subscription in PENDING_PAYMENT status
165
+ 4. Returns Stripe Checkout URL
166
+ 5. User completes payment on Stripe
167
+ 6. Webhook activates subscription and provisions resource
168
+
169
+ **Enterprise customers** (with invoice_billing_enabled) should not call this endpoint.
170
+
171
+ Args:
172
+ body (CreateCheckoutRequest): Request to create a checkout session for payment collection.
173
+
174
+ Raises:
175
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
176
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
177
+
178
+ Returns:
179
+ Response[Union[CheckoutResponse, HTTPValidationError]]
180
+ """
181
+
182
+ kwargs = _get_kwargs(
183
+ body=body,
184
+ )
185
+
186
+ response = await client.get_async_httpx_client().request(**kwargs)
187
+
188
+ return _build_response(client=client, response=response)
189
+
190
+
191
+ async def asyncio(
192
+ *,
193
+ client: AuthenticatedClient,
194
+ body: CreateCheckoutRequest,
195
+ ) -> Optional[Union[CheckoutResponse, HTTPValidationError]]:
196
+ """Create Payment Checkout Session
197
+
198
+ Create a Stripe checkout session for collecting payment method.
199
+
200
+ This endpoint is used when a user needs to add a payment method before
201
+ provisioning resources. It creates a pending subscription and redirects
202
+ the user to Stripe Checkout to collect payment details.
203
+
204
+ **Flow:**
205
+ 1. User tries to create a graph but has no payment method
206
+ 2. Frontend calls this endpoint with graph configuration
207
+ 3. Backend creates a subscription in PENDING_PAYMENT status
208
+ 4. Returns Stripe Checkout URL
209
+ 5. User completes payment on Stripe
210
+ 6. Webhook activates subscription and provisions resource
211
+
212
+ **Enterprise customers** (with invoice_billing_enabled) should not call this endpoint.
213
+
214
+ Args:
215
+ body (CreateCheckoutRequest): Request to create a checkout session for payment collection.
216
+
217
+ Raises:
218
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
219
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
220
+
221
+ Returns:
222
+ Union[CheckoutResponse, HTTPValidationError]
223
+ """
224
+
225
+ return (
226
+ await asyncio_detailed(
227
+ client=client,
228
+ body=body,
229
+ )
230
+ ).parsed
@@ -5,14 +5,14 @@ import httpx
5
5
 
6
6
  from ... import errors
7
7
  from ...client import AuthenticatedClient, Client
8
- from ...models.user_usage_summary_response import UserUsageSummaryResponse
8
+ from ...models.billing_customer import BillingCustomer
9
9
  from ...types import Response
10
10
 
11
11
 
12
12
  def _get_kwargs() -> dict[str, Any]:
13
13
  _kwargs: dict[str, Any] = {
14
14
  "method": "get",
15
- "url": "/v1/user/analytics/overview",
15
+ "url": "/v1/billing/customer",
16
16
  }
17
17
 
18
18
  return _kwargs
@@ -20,9 +20,9 @@ def _get_kwargs() -> dict[str, Any]:
20
20
 
21
21
  def _parse_response(
22
22
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
23
- ) -> Optional[UserUsageSummaryResponse]:
23
+ ) -> Optional[BillingCustomer]:
24
24
  if response.status_code == 200:
25
- response_200 = UserUsageSummaryResponse.from_dict(response.json())
25
+ response_200 = BillingCustomer.from_dict(response.json())
26
26
 
27
27
  return response_200
28
28
 
@@ -34,7 +34,7 @@ def _parse_response(
34
34
 
35
35
  def _build_response(
36
36
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
37
- ) -> Response[UserUsageSummaryResponse]:
37
+ ) -> Response[BillingCustomer]:
38
38
  return Response(
39
39
  status_code=HTTPStatus(response.status_code),
40
40
  content=response.content,
@@ -46,17 +46,19 @@ def _build_response(
46
46
  def sync_detailed(
47
47
  *,
48
48
  client: AuthenticatedClient,
49
- ) -> Response[UserUsageSummaryResponse]:
50
- """Get User Usage Overview
49
+ ) -> Response[BillingCustomer]:
50
+ """Get Customer Info
51
51
 
52
- Get a high-level overview of usage statistics for the current user.
52
+ Get billing customer information including payment methods on file.
53
+
54
+ Returns customer details, payment methods, and whether invoice billing is enabled.
53
55
 
54
56
  Raises:
55
57
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
56
58
  httpx.TimeoutException: If the request takes longer than Client.timeout.
57
59
 
58
60
  Returns:
59
- Response[UserUsageSummaryResponse]
61
+ Response[BillingCustomer]
60
62
  """
61
63
 
62
64
  kwargs = _get_kwargs()
@@ -71,17 +73,19 @@ def sync_detailed(
71
73
  def sync(
72
74
  *,
73
75
  client: AuthenticatedClient,
74
- ) -> Optional[UserUsageSummaryResponse]:
75
- """Get User Usage Overview
76
+ ) -> Optional[BillingCustomer]:
77
+ """Get Customer Info
78
+
79
+ Get billing customer information including payment methods on file.
76
80
 
77
- Get a high-level overview of usage statistics for the current user.
81
+ Returns customer details, payment methods, and whether invoice billing is enabled.
78
82
 
79
83
  Raises:
80
84
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
81
85
  httpx.TimeoutException: If the request takes longer than Client.timeout.
82
86
 
83
87
  Returns:
84
- UserUsageSummaryResponse
88
+ BillingCustomer
85
89
  """
86
90
 
87
91
  return sync_detailed(
@@ -92,17 +96,19 @@ def sync(
92
96
  async def asyncio_detailed(
93
97
  *,
94
98
  client: AuthenticatedClient,
95
- ) -> Response[UserUsageSummaryResponse]:
96
- """Get User Usage Overview
99
+ ) -> Response[BillingCustomer]:
100
+ """Get Customer Info
97
101
 
98
- Get a high-level overview of usage statistics for the current user.
102
+ Get billing customer information including payment methods on file.
103
+
104
+ Returns customer details, payment methods, and whether invoice billing is enabled.
99
105
 
100
106
  Raises:
101
107
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
102
108
  httpx.TimeoutException: If the request takes longer than Client.timeout.
103
109
 
104
110
  Returns:
105
- Response[UserUsageSummaryResponse]
111
+ Response[BillingCustomer]
106
112
  """
107
113
 
108
114
  kwargs = _get_kwargs()
@@ -115,17 +121,19 @@ async def asyncio_detailed(
115
121
  async def asyncio(
116
122
  *,
117
123
  client: AuthenticatedClient,
118
- ) -> Optional[UserUsageSummaryResponse]:
119
- """Get User Usage Overview
124
+ ) -> Optional[BillingCustomer]:
125
+ """Get Customer Info
126
+
127
+ Get billing customer information including payment methods on file.
120
128
 
121
- Get a high-level overview of usage statistics for the current user.
129
+ Returns customer details, payment methods, and whether invoice billing is enabled.
122
130
 
123
131
  Raises:
124
132
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
125
133
  httpx.TimeoutException: If the request takes longer than Client.timeout.
126
134
 
127
135
  Returns:
128
- UserUsageSummaryResponse
136
+ BillingCustomer
129
137
  """
130
138
 
131
139
  return (