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
@@ -0,0 +1,203 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union, cast
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.graph_subscription_response import GraphSubscriptionResponse
9
+ from ...models.http_validation_error import HTTPValidationError
10
+ from ...models.upgrade_subscription_request import UpgradeSubscriptionRequest
11
+ from ...types import Response
12
+
13
+
14
+ def _get_kwargs(
15
+ graph_id: str,
16
+ *,
17
+ body: UpgradeSubscriptionRequest,
18
+ ) -> dict[str, Any]:
19
+ headers: dict[str, Any] = {}
20
+
21
+ _kwargs: dict[str, Any] = {
22
+ "method": "put",
23
+ "url": f"/v1/graphs/{graph_id}/subscriptions/upgrade",
24
+ }
25
+
26
+ _kwargs["json"] = body.to_dict()
27
+
28
+ headers["Content-Type"] = "application/json"
29
+
30
+ _kwargs["headers"] = headers
31
+ return _kwargs
32
+
33
+
34
+ def _parse_response(
35
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
36
+ ) -> Optional[Union[Any, GraphSubscriptionResponse, HTTPValidationError]]:
37
+ if response.status_code == 200:
38
+ response_200 = GraphSubscriptionResponse.from_dict(response.json())
39
+
40
+ return response_200
41
+
42
+ if response.status_code == 404:
43
+ response_404 = cast(Any, None)
44
+ return response_404
45
+
46
+ if response.status_code == 422:
47
+ response_422 = HTTPValidationError.from_dict(response.json())
48
+
49
+ return response_422
50
+
51
+ if client.raise_on_unexpected_status:
52
+ raise errors.UnexpectedStatus(response.status_code, response.content)
53
+ else:
54
+ return None
55
+
56
+
57
+ def _build_response(
58
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
59
+ ) -> Response[Union[Any, GraphSubscriptionResponse, HTTPValidationError]]:
60
+ return Response(
61
+ status_code=HTTPStatus(response.status_code),
62
+ content=response.content,
63
+ headers=response.headers,
64
+ parsed=_parse_response(client=client, response=response),
65
+ )
66
+
67
+
68
+ def sync_detailed(
69
+ graph_id: str,
70
+ *,
71
+ client: AuthenticatedClient,
72
+ body: UpgradeSubscriptionRequest,
73
+ ) -> Response[Union[Any, GraphSubscriptionResponse, HTTPValidationError]]:
74
+ """Upgrade Subscription
75
+
76
+ Upgrade a subscription to a different plan.
77
+
78
+ Works for both user graphs and shared repositories.
79
+ The subscription will be immediately updated to the new plan and pricing.
80
+
81
+ Args:
82
+ graph_id (str): Graph ID or repository name
83
+ body (UpgradeSubscriptionRequest): Request to upgrade a subscription.
84
+
85
+ Raises:
86
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
87
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
88
+
89
+ Returns:
90
+ Response[Union[Any, GraphSubscriptionResponse, HTTPValidationError]]
91
+ """
92
+
93
+ kwargs = _get_kwargs(
94
+ graph_id=graph_id,
95
+ body=body,
96
+ )
97
+
98
+ response = client.get_httpx_client().request(
99
+ **kwargs,
100
+ )
101
+
102
+ return _build_response(client=client, response=response)
103
+
104
+
105
+ def sync(
106
+ graph_id: str,
107
+ *,
108
+ client: AuthenticatedClient,
109
+ body: UpgradeSubscriptionRequest,
110
+ ) -> Optional[Union[Any, GraphSubscriptionResponse, HTTPValidationError]]:
111
+ """Upgrade Subscription
112
+
113
+ Upgrade a subscription to a different plan.
114
+
115
+ Works for both user graphs and shared repositories.
116
+ The subscription will be immediately updated to the new plan and pricing.
117
+
118
+ Args:
119
+ graph_id (str): Graph ID or repository name
120
+ body (UpgradeSubscriptionRequest): Request to upgrade a subscription.
121
+
122
+ Raises:
123
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
124
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
125
+
126
+ Returns:
127
+ Union[Any, GraphSubscriptionResponse, HTTPValidationError]
128
+ """
129
+
130
+ return sync_detailed(
131
+ graph_id=graph_id,
132
+ client=client,
133
+ body=body,
134
+ ).parsed
135
+
136
+
137
+ async def asyncio_detailed(
138
+ graph_id: str,
139
+ *,
140
+ client: AuthenticatedClient,
141
+ body: UpgradeSubscriptionRequest,
142
+ ) -> Response[Union[Any, GraphSubscriptionResponse, HTTPValidationError]]:
143
+ """Upgrade Subscription
144
+
145
+ Upgrade a subscription to a different plan.
146
+
147
+ Works for both user graphs and shared repositories.
148
+ The subscription will be immediately updated to the new plan and pricing.
149
+
150
+ Args:
151
+ graph_id (str): Graph ID or repository name
152
+ body (UpgradeSubscriptionRequest): Request to upgrade a subscription.
153
+
154
+ Raises:
155
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
156
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
157
+
158
+ Returns:
159
+ Response[Union[Any, GraphSubscriptionResponse, HTTPValidationError]]
160
+ """
161
+
162
+ kwargs = _get_kwargs(
163
+ graph_id=graph_id,
164
+ body=body,
165
+ )
166
+
167
+ response = await client.get_async_httpx_client().request(**kwargs)
168
+
169
+ return _build_response(client=client, response=response)
170
+
171
+
172
+ async def asyncio(
173
+ graph_id: str,
174
+ *,
175
+ client: AuthenticatedClient,
176
+ body: UpgradeSubscriptionRequest,
177
+ ) -> Optional[Union[Any, GraphSubscriptionResponse, HTTPValidationError]]:
178
+ """Upgrade Subscription
179
+
180
+ Upgrade a subscription to a different plan.
181
+
182
+ Works for both user graphs and shared repositories.
183
+ The subscription will be immediately updated to the new plan and pricing.
184
+
185
+ Args:
186
+ graph_id (str): Graph ID or repository name
187
+ body (UpgradeSubscriptionRequest): Request to upgrade a subscription.
188
+
189
+ Raises:
190
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
191
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
192
+
193
+ Returns:
194
+ Union[Any, GraphSubscriptionResponse, HTTPValidationError]
195
+ """
196
+
197
+ return (
198
+ await asyncio_detailed(
199
+ graph_id=graph_id,
200
+ client=client,
201
+ body=body,
202
+ )
203
+ ).parsed
@@ -0,0 +1,377 @@
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.error_response import ErrorResponse
9
+ from ...models.graph_usage_response import GraphUsageResponse
10
+ from ...models.http_validation_error import HTTPValidationError
11
+ from ...types import UNSET, Response, Unset
12
+
13
+
14
+ def _get_kwargs(
15
+ graph_id: str,
16
+ *,
17
+ time_range: Union[Unset, str] = "30d",
18
+ include_storage: Union[Unset, bool] = True,
19
+ include_credits: Union[Unset, bool] = True,
20
+ include_performance: Union[Unset, bool] = False,
21
+ include_events: Union[Unset, bool] = False,
22
+ ) -> dict[str, Any]:
23
+ params: dict[str, Any] = {}
24
+
25
+ params["time_range"] = time_range
26
+
27
+ params["include_storage"] = include_storage
28
+
29
+ params["include_credits"] = include_credits
30
+
31
+ params["include_performance"] = include_performance
32
+
33
+ params["include_events"] = include_events
34
+
35
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
36
+
37
+ _kwargs: dict[str, Any] = {
38
+ "method": "get",
39
+ "url": f"/v1/graphs/{graph_id}/analytics/usage",
40
+ "params": params,
41
+ }
42
+
43
+ return _kwargs
44
+
45
+
46
+ def _parse_response(
47
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
48
+ ) -> Optional[Union[ErrorResponse, GraphUsageResponse, HTTPValidationError]]:
49
+ if response.status_code == 200:
50
+ response_200 = GraphUsageResponse.from_dict(response.json())
51
+
52
+ return response_200
53
+
54
+ if response.status_code == 403:
55
+ response_403 = ErrorResponse.from_dict(response.json())
56
+
57
+ return response_403
58
+
59
+ if response.status_code == 422:
60
+ response_422 = HTTPValidationError.from_dict(response.json())
61
+
62
+ return response_422
63
+
64
+ if response.status_code == 500:
65
+ response_500 = ErrorResponse.from_dict(response.json())
66
+
67
+ return response_500
68
+
69
+ if client.raise_on_unexpected_status:
70
+ raise errors.UnexpectedStatus(response.status_code, response.content)
71
+ else:
72
+ return None
73
+
74
+
75
+ def _build_response(
76
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
77
+ ) -> Response[Union[ErrorResponse, GraphUsageResponse, HTTPValidationError]]:
78
+ return Response(
79
+ status_code=HTTPStatus(response.status_code),
80
+ content=response.content,
81
+ headers=response.headers,
82
+ parsed=_parse_response(client=client, response=response),
83
+ )
84
+
85
+
86
+ def sync_detailed(
87
+ graph_id: str,
88
+ *,
89
+ client: AuthenticatedClient,
90
+ time_range: Union[Unset, str] = "30d",
91
+ include_storage: Union[Unset, bool] = True,
92
+ include_credits: Union[Unset, bool] = True,
93
+ include_performance: Union[Unset, bool] = False,
94
+ include_events: Union[Unset, bool] = False,
95
+ ) -> Response[Union[ErrorResponse, GraphUsageResponse, HTTPValidationError]]:
96
+ """Get Graph Usage Analytics
97
+
98
+ Get comprehensive usage analytics tracked by the GraphUsageTracking model.
99
+
100
+ Provides temporal usage patterns including:
101
+ - **Storage Analytics**: GB-hours for billing, breakdown by type (files, tables, graphs, subgraphs)
102
+ - **Credit Analytics**: Consumption patterns, operation breakdown, cached vs billable
103
+ - **Performance Insights**: Operation stats, slow queries, performance scoring
104
+ - **Recent Events**: Latest usage events with full details
105
+
106
+ Time ranges available:
107
+ - `24h` - Last 24 hours (hourly breakdown)
108
+ - `7d` - Last 7 days (daily breakdown)
109
+ - `30d` - Last 30 days (daily breakdown)
110
+ - `current_month` - Current billing month
111
+ - `last_month` - Previous billing month
112
+
113
+ Include options:
114
+ - `storage` - Storage usage summary (GB-hours, averages, peaks)
115
+ - `credits` - Credit consumption analytics
116
+ - `performance` - Performance insights and optimization opportunities
117
+ - `events` - Recent usage events (last 50)
118
+
119
+ Useful for:
120
+ - Billing and cost analysis
121
+ - Capacity planning
122
+ - Performance optimization
123
+ - Usage trend analysis
124
+
125
+ Note:
126
+ This operation is included - no credit consumption required.
127
+
128
+ Args:
129
+ graph_id (str):
130
+ time_range (Union[Unset, str]): Time range: 24h, 7d, 30d, current_month, last_month
131
+ Default: '30d'.
132
+ include_storage (Union[Unset, bool]): Include storage usage summary Default: True.
133
+ include_credits (Union[Unset, bool]): Include credit consumption summary Default: True.
134
+ include_performance (Union[Unset, bool]): Include performance insights (may be slower)
135
+ Default: False.
136
+ include_events (Union[Unset, bool]): Include recent usage events Default: False.
137
+
138
+ Raises:
139
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
140
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
141
+
142
+ Returns:
143
+ Response[Union[ErrorResponse, GraphUsageResponse, HTTPValidationError]]
144
+ """
145
+
146
+ kwargs = _get_kwargs(
147
+ graph_id=graph_id,
148
+ time_range=time_range,
149
+ include_storage=include_storage,
150
+ include_credits=include_credits,
151
+ include_performance=include_performance,
152
+ include_events=include_events,
153
+ )
154
+
155
+ response = client.get_httpx_client().request(
156
+ **kwargs,
157
+ )
158
+
159
+ return _build_response(client=client, response=response)
160
+
161
+
162
+ def sync(
163
+ graph_id: str,
164
+ *,
165
+ client: AuthenticatedClient,
166
+ time_range: Union[Unset, str] = "30d",
167
+ include_storage: Union[Unset, bool] = True,
168
+ include_credits: Union[Unset, bool] = True,
169
+ include_performance: Union[Unset, bool] = False,
170
+ include_events: Union[Unset, bool] = False,
171
+ ) -> Optional[Union[ErrorResponse, GraphUsageResponse, HTTPValidationError]]:
172
+ """Get Graph Usage Analytics
173
+
174
+ Get comprehensive usage analytics tracked by the GraphUsageTracking model.
175
+
176
+ Provides temporal usage patterns including:
177
+ - **Storage Analytics**: GB-hours for billing, breakdown by type (files, tables, graphs, subgraphs)
178
+ - **Credit Analytics**: Consumption patterns, operation breakdown, cached vs billable
179
+ - **Performance Insights**: Operation stats, slow queries, performance scoring
180
+ - **Recent Events**: Latest usage events with full details
181
+
182
+ Time ranges available:
183
+ - `24h` - Last 24 hours (hourly breakdown)
184
+ - `7d` - Last 7 days (daily breakdown)
185
+ - `30d` - Last 30 days (daily breakdown)
186
+ - `current_month` - Current billing month
187
+ - `last_month` - Previous billing month
188
+
189
+ Include options:
190
+ - `storage` - Storage usage summary (GB-hours, averages, peaks)
191
+ - `credits` - Credit consumption analytics
192
+ - `performance` - Performance insights and optimization opportunities
193
+ - `events` - Recent usage events (last 50)
194
+
195
+ Useful for:
196
+ - Billing and cost analysis
197
+ - Capacity planning
198
+ - Performance optimization
199
+ - Usage trend analysis
200
+
201
+ Note:
202
+ This operation is included - no credit consumption required.
203
+
204
+ Args:
205
+ graph_id (str):
206
+ time_range (Union[Unset, str]): Time range: 24h, 7d, 30d, current_month, last_month
207
+ Default: '30d'.
208
+ include_storage (Union[Unset, bool]): Include storage usage summary Default: True.
209
+ include_credits (Union[Unset, bool]): Include credit consumption summary Default: True.
210
+ include_performance (Union[Unset, bool]): Include performance insights (may be slower)
211
+ Default: False.
212
+ include_events (Union[Unset, bool]): Include recent usage events Default: False.
213
+
214
+ Raises:
215
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
216
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
217
+
218
+ Returns:
219
+ Union[ErrorResponse, GraphUsageResponse, HTTPValidationError]
220
+ """
221
+
222
+ return sync_detailed(
223
+ graph_id=graph_id,
224
+ client=client,
225
+ time_range=time_range,
226
+ include_storage=include_storage,
227
+ include_credits=include_credits,
228
+ include_performance=include_performance,
229
+ include_events=include_events,
230
+ ).parsed
231
+
232
+
233
+ async def asyncio_detailed(
234
+ graph_id: str,
235
+ *,
236
+ client: AuthenticatedClient,
237
+ time_range: Union[Unset, str] = "30d",
238
+ include_storage: Union[Unset, bool] = True,
239
+ include_credits: Union[Unset, bool] = True,
240
+ include_performance: Union[Unset, bool] = False,
241
+ include_events: Union[Unset, bool] = False,
242
+ ) -> Response[Union[ErrorResponse, GraphUsageResponse, HTTPValidationError]]:
243
+ """Get Graph Usage Analytics
244
+
245
+ Get comprehensive usage analytics tracked by the GraphUsageTracking model.
246
+
247
+ Provides temporal usage patterns including:
248
+ - **Storage Analytics**: GB-hours for billing, breakdown by type (files, tables, graphs, subgraphs)
249
+ - **Credit Analytics**: Consumption patterns, operation breakdown, cached vs billable
250
+ - **Performance Insights**: Operation stats, slow queries, performance scoring
251
+ - **Recent Events**: Latest usage events with full details
252
+
253
+ Time ranges available:
254
+ - `24h` - Last 24 hours (hourly breakdown)
255
+ - `7d` - Last 7 days (daily breakdown)
256
+ - `30d` - Last 30 days (daily breakdown)
257
+ - `current_month` - Current billing month
258
+ - `last_month` - Previous billing month
259
+
260
+ Include options:
261
+ - `storage` - Storage usage summary (GB-hours, averages, peaks)
262
+ - `credits` - Credit consumption analytics
263
+ - `performance` - Performance insights and optimization opportunities
264
+ - `events` - Recent usage events (last 50)
265
+
266
+ Useful for:
267
+ - Billing and cost analysis
268
+ - Capacity planning
269
+ - Performance optimization
270
+ - Usage trend analysis
271
+
272
+ Note:
273
+ This operation is included - no credit consumption required.
274
+
275
+ Args:
276
+ graph_id (str):
277
+ time_range (Union[Unset, str]): Time range: 24h, 7d, 30d, current_month, last_month
278
+ Default: '30d'.
279
+ include_storage (Union[Unset, bool]): Include storage usage summary Default: True.
280
+ include_credits (Union[Unset, bool]): Include credit consumption summary Default: True.
281
+ include_performance (Union[Unset, bool]): Include performance insights (may be slower)
282
+ Default: False.
283
+ include_events (Union[Unset, bool]): Include recent usage events Default: False.
284
+
285
+ Raises:
286
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
287
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
288
+
289
+ Returns:
290
+ Response[Union[ErrorResponse, GraphUsageResponse, HTTPValidationError]]
291
+ """
292
+
293
+ kwargs = _get_kwargs(
294
+ graph_id=graph_id,
295
+ time_range=time_range,
296
+ include_storage=include_storage,
297
+ include_credits=include_credits,
298
+ include_performance=include_performance,
299
+ include_events=include_events,
300
+ )
301
+
302
+ response = await client.get_async_httpx_client().request(**kwargs)
303
+
304
+ return _build_response(client=client, response=response)
305
+
306
+
307
+ async def asyncio(
308
+ graph_id: str,
309
+ *,
310
+ client: AuthenticatedClient,
311
+ time_range: Union[Unset, str] = "30d",
312
+ include_storage: Union[Unset, bool] = True,
313
+ include_credits: Union[Unset, bool] = True,
314
+ include_performance: Union[Unset, bool] = False,
315
+ include_events: Union[Unset, bool] = False,
316
+ ) -> Optional[Union[ErrorResponse, GraphUsageResponse, HTTPValidationError]]:
317
+ """Get Graph Usage Analytics
318
+
319
+ Get comprehensive usage analytics tracked by the GraphUsageTracking model.
320
+
321
+ Provides temporal usage patterns including:
322
+ - **Storage Analytics**: GB-hours for billing, breakdown by type (files, tables, graphs, subgraphs)
323
+ - **Credit Analytics**: Consumption patterns, operation breakdown, cached vs billable
324
+ - **Performance Insights**: Operation stats, slow queries, performance scoring
325
+ - **Recent Events**: Latest usage events with full details
326
+
327
+ Time ranges available:
328
+ - `24h` - Last 24 hours (hourly breakdown)
329
+ - `7d` - Last 7 days (daily breakdown)
330
+ - `30d` - Last 30 days (daily breakdown)
331
+ - `current_month` - Current billing month
332
+ - `last_month` - Previous billing month
333
+
334
+ Include options:
335
+ - `storage` - Storage usage summary (GB-hours, averages, peaks)
336
+ - `credits` - Credit consumption analytics
337
+ - `performance` - Performance insights and optimization opportunities
338
+ - `events` - Recent usage events (last 50)
339
+
340
+ Useful for:
341
+ - Billing and cost analysis
342
+ - Capacity planning
343
+ - Performance optimization
344
+ - Usage trend analysis
345
+
346
+ Note:
347
+ This operation is included - no credit consumption required.
348
+
349
+ Args:
350
+ graph_id (str):
351
+ time_range (Union[Unset, str]): Time range: 24h, 7d, 30d, current_month, last_month
352
+ Default: '30d'.
353
+ include_storage (Union[Unset, bool]): Include storage usage summary Default: True.
354
+ include_credits (Union[Unset, bool]): Include credit consumption summary Default: True.
355
+ include_performance (Union[Unset, bool]): Include performance insights (may be slower)
356
+ Default: False.
357
+ include_events (Union[Unset, bool]): Include recent usage events Default: False.
358
+
359
+ Raises:
360
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
361
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
362
+
363
+ Returns:
364
+ Union[ErrorResponse, GraphUsageResponse, HTTPValidationError]
365
+ """
366
+
367
+ return (
368
+ await asyncio_detailed(
369
+ graph_id=graph_id,
370
+ client=client,
371
+ time_range=time_range,
372
+ include_storage=include_storage,
373
+ include_credits=include_credits,
374
+ include_performance=include_performance,
375
+ include_events=include_events,
376
+ )
377
+ ).parsed
@@ -12,7 +12,7 @@ from ...types import Response
12
12
  def _get_kwargs() -> dict[str, Any]:
13
13
  _kwargs: dict[str, Any] = {
14
14
  "method": "get",
15
- "url": "/v1/user/limits/usage",
15
+ "url": "/v1/user/limits",
16
16
  }
17
17
 
18
18
  return _kwargs
@@ -47,9 +47,10 @@ def sync_detailed(
47
47
  *,
48
48
  client: AuthenticatedClient,
49
49
  ) -> Response[UserUsageResponse]:
50
- """Get user usage statistics
50
+ """Get user limits and usage
51
51
 
52
- Retrieve current usage statistics and remaining limits for the authenticated user
52
+ Retrieve current limits and usage statistics for the authenticated user (simple safety valve for
53
+ graph creation)
53
54
 
54
55
  Raises:
55
56
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -72,9 +73,10 @@ def sync(
72
73
  *,
73
74
  client: AuthenticatedClient,
74
75
  ) -> Optional[UserUsageResponse]:
75
- """Get user usage statistics
76
+ """Get user limits and usage
76
77
 
77
- Retrieve current usage statistics and remaining limits for the authenticated user
78
+ Retrieve current limits and usage statistics for the authenticated user (simple safety valve for
79
+ graph creation)
78
80
 
79
81
  Raises:
80
82
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -93,9 +95,10 @@ async def asyncio_detailed(
93
95
  *,
94
96
  client: AuthenticatedClient,
95
97
  ) -> Response[UserUsageResponse]:
96
- """Get user usage statistics
98
+ """Get user limits and usage
97
99
 
98
- Retrieve current usage statistics and remaining limits for the authenticated user
100
+ Retrieve current limits and usage statistics for the authenticated user (simple safety valve for
101
+ graph creation)
99
102
 
100
103
  Raises:
101
104
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -116,9 +119,10 @@ async def asyncio(
116
119
  *,
117
120
  client: AuthenticatedClient,
118
121
  ) -> Optional[UserUsageResponse]:
119
- """Get user usage statistics
122
+ """Get user limits and usage
120
123
 
121
- Retrieve current usage statistics and remaining limits for the authenticated user
124
+ Retrieve current limits and usage statistics for the authenticated user (simple safety valve for
125
+ graph creation)
122
126
 
123
127
  Raises:
124
128
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.