robosystems-client 0.2.2__py3-none-any.whl → 0.2.4__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.
Potentially problematic release.
This version of robosystems-client might be problematic. Click here for more details.
- robosystems_client/api/agent/auto_select_agent.py +1 -41
- robosystems_client/api/agent/batch_process_queries.py +1 -41
- robosystems_client/api/agent/execute_specific_agent.py +1 -41
- robosystems_client/api/agent/get_agent_metadata.py +5 -49
- robosystems_client/api/agent/list_agents.py +4 -42
- robosystems_client/api/agent/recommend_agent.py +5 -45
- robosystems_client/api/auth/generate_sso_token.py +0 -18
- robosystems_client/api/auth/get_current_auth_user.py +14 -74
- robosystems_client/api/auth/logout_user.py +14 -50
- robosystems_client/api/auth/refresh_auth_session.py +14 -50
- robosystems_client/api/auth/resend_verification_email.py +14 -74
- robosystems_client/api/backup/create_backup.py +5 -45
- robosystems_client/api/backup/get_backup_download_url.py +4 -42
- robosystems_client/api/backup/get_backup_stats.py +5 -49
- robosystems_client/api/backup/list_backups.py +4 -42
- robosystems_client/api/backup/restore_backup.py +5 -45
- robosystems_client/api/connections/create_connection.py +5 -45
- robosystems_client/api/connections/create_link_token.py +5 -45
- robosystems_client/api/connections/delete_connection.py +5 -49
- robosystems_client/api/connections/exchange_link_token.py +5 -45
- robosystems_client/api/connections/get_connection.py +5 -49
- robosystems_client/api/connections/get_connection_options.py +5 -49
- robosystems_client/api/connections/init_o_auth.py +5 -45
- robosystems_client/api/connections/list_connections.py +4 -42
- robosystems_client/api/connections/oauth_callback.py +5 -45
- robosystems_client/api/connections/sync_connection.py +5 -45
- robosystems_client/api/graph_analytics/get_graph_metrics.py +5 -49
- robosystems_client/api/graph_analytics/get_graph_usage_stats.py +4 -42
- robosystems_client/api/graph_billing/get_current_graph_bill.py +5 -49
- robosystems_client/api/graph_billing/get_graph_billing_history.py +4 -42
- robosystems_client/api/graph_billing/get_graph_monthly_bill.py +5 -49
- robosystems_client/api/graph_billing/get_graph_usage_details.py +4 -42
- robosystems_client/api/graph_credits/check_credit_balance.py +0 -38
- robosystems_client/api/graph_credits/check_storage_limits.py +1 -45
- robosystems_client/api/graph_credits/get_credit_summary.py +1 -45
- robosystems_client/api/graph_credits/get_storage_usage.py +0 -38
- robosystems_client/api/graph_credits/list_credit_transactions.py +4 -42
- robosystems_client/api/graph_health/get_database_health.py +5 -49
- robosystems_client/api/graph_info/get_database_info.py +5 -49
- robosystems_client/api/graph_limits/get_graph_limits.py +5 -49
- robosystems_client/api/graphs/create_graph.py +21 -57
- robosystems_client/api/graphs/get_available_extensions.py +131 -15
- robosystems_client/api/graphs/get_graphs.py +154 -79
- robosystems_client/api/graphs/select_graph.py +117 -49
- robosystems_client/api/mcp/call_mcp_tool.py +24 -47
- robosystems_client/api/mcp/list_mcp_tools.py +13 -61
- robosystems_client/api/operations/cancel_operation.py +1 -45
- robosystems_client/api/operations/get_operation_status.py +1 -45
- robosystems_client/api/query/execute_cypher_query.py +68 -57
- robosystems_client/api/schema/export_graph_schema.py +223 -65
- robosystems_client/api/schema/get_graph_schema.py +137 -79
- robosystems_client/api/schema/validate_schema.py +5 -45
- robosystems_client/api/subgraphs/create_subgraph.py +5 -45
- robosystems_client/api/subgraphs/delete_subgraph.py +5 -45
- robosystems_client/api/subgraphs/get_subgraph_info.py +5 -49
- robosystems_client/api/subgraphs/get_subgraph_quota.py +5 -49
- robosystems_client/api/subgraphs/list_subgraphs.py +5 -49
- robosystems_client/api/tables/delete_file.py +317 -0
- robosystems_client/api/tables/get_file_info.py +249 -0
- robosystems_client/api/tables/get_upload_url.py +352 -0
- robosystems_client/api/tables/ingest_tables.py +428 -0
- robosystems_client/api/tables/list_table_files.py +329 -0
- robosystems_client/api/tables/list_tables.py +316 -0
- robosystems_client/api/tables/query_tables.py +431 -0
- robosystems_client/api/tables/update_file_status.py +395 -0
- robosystems_client/api/user/create_user_api_key.py +1 -41
- robosystems_client/api/user/get_all_credit_summaries.py +14 -111
- robosystems_client/api/user/get_current_user.py +14 -75
- robosystems_client/api/user/list_user_api_keys.py +14 -75
- robosystems_client/api/user/revoke_user_api_key.py +1 -45
- robosystems_client/api/user/update_user.py +1 -41
- robosystems_client/api/user/update_user_api_key.py +1 -41
- robosystems_client/api/user/update_user_password.py +1 -41
- robosystems_client/api/user_analytics/get_detailed_user_analytics.py +0 -38
- robosystems_client/api/user_analytics/get_user_usage_overview.py +14 -75
- robosystems_client/api/user_limits/get_all_shared_repository_limits.py +14 -105
- robosystems_client/api/user_limits/get_shared_repository_limits.py +1 -45
- robosystems_client/api/user_limits/get_user_limits.py +14 -75
- robosystems_client/api/user_limits/get_user_usage.py +14 -75
- robosystems_client/api/user_subscriptions/cancel_shared_repository_subscription.py +1 -45
- robosystems_client/api/user_subscriptions/get_repository_credits.py +1 -45
- robosystems_client/api/user_subscriptions/get_shared_repository_credits.py +14 -75
- robosystems_client/api/user_subscriptions/get_user_shared_subscriptions.py +0 -38
- robosystems_client/api/user_subscriptions/subscribe_to_shared_repository.py +1 -41
- robosystems_client/api/user_subscriptions/upgrade_shared_repository_subscription.py +1 -41
- robosystems_client/extensions/__init__.py +8 -1
- robosystems_client/extensions/auth_integration.py +1 -2
- robosystems_client/extensions/graph_client.py +5 -0
- robosystems_client/extensions/query_client.py +3 -2
- robosystems_client/extensions/sse_client.py +1 -1
- robosystems_client/extensions/table_ingest_client.py +36 -40
- robosystems_client/extensions/utils.py +2 -2
- robosystems_client/models/__init__.py +17 -21
- robosystems_client/models/create_graph_request.py +15 -3
- robosystems_client/models/cypher_query_request.py +5 -22
- robosystems_client/models/{delete_file_v1_graphs_graph_id_tables_files_file_id_delete_response_delete_file_v1_graphs_graph_id_tables_files_file_id_delete.py → delete_file_response.py} +45 -9
- robosystems_client/models/file_info.py +169 -0
- robosystems_client/models/file_status_update.py +41 -0
- robosystems_client/models/get_file_info_response.py +205 -0
- robosystems_client/models/list_table_files_response.py +105 -0
- robosystems_client/models/schema_export_response.py +4 -2
- robosystems_client/models/schema_info_response.py +77 -0
- robosystems_client/models/{get_graph_schema_response_getgraphschema.py → schema_info_response_schema.py} +6 -6
- robosystems_client/models/schema_validation_response.py +7 -6
- robosystems_client/models/table_query_request.py +37 -2
- robosystems_client/models/{get_file_info_v1_graphs_graph_id_tables_files_file_id_get_response_get_file_info_v1_graphs_graph_id_tables_files_file_id_get.py → update_file_status_response_updatefilestatus.py} +5 -8
- {robosystems_client-0.2.2.dist-info → robosystems_client-0.2.4.dist-info}/METADATA +2 -4
- {robosystems_client-0.2.2.dist-info → robosystems_client-0.2.4.dist-info}/RECORD +110 -108
- robosystems_client/api/tables/delete_file_v1_graphs_graph_id_tables_files_file_id_delete.py +0 -287
- robosystems_client/api/tables/get_file_info_v1_graphs_graph_id_tables_files_file_id_get.py +0 -283
- robosystems_client/api/tables/get_upload_url_v1_graphs_graph_id_tables_table_name_files_post.py +0 -260
- robosystems_client/api/tables/ingest_tables_v1_graphs_graph_id_tables_ingest_post.py +0 -251
- robosystems_client/api/tables/list_table_files_v1_graphs_graph_id_tables_table_name_files_get.py +0 -283
- robosystems_client/api/tables/list_tables_v1_graphs_graph_id_tables_get.py +0 -224
- robosystems_client/api/tables/query_tables_v1_graphs_graph_id_tables_query_post.py +0 -247
- robosystems_client/api/tables/update_file_v1_graphs_graph_id_tables_files_file_id_patch.py +0 -306
- robosystems_client/models/file_update_request.py +0 -62
- robosystems_client/models/list_table_files_v1_graphs_graph_id_tables_table_name_files_get_response_list_table_files_v1_graphs_graph_id_tables_table_name_files_get.py +0 -47
- robosystems_client/models/update_file_v1_graphs_graph_id_tables_files_file_id_patch_response_update_file_v1_graphs_graph_id_tables_files_file_id_patch.py +0 -47
- {robosystems_client-0.2.2.dist-info → robosystems_client-0.2.4.dist-info}/WHEEL +0 -0
- {robosystems_client-0.2.2.dist-info → robosystems_client-0.2.4.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,395 @@
|
|
|
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.error_response import ErrorResponse
|
|
9
|
+
from ...models.file_status_update import FileStatusUpdate
|
|
10
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
11
|
+
from ...models.update_file_status_response_updatefilestatus import (
|
|
12
|
+
UpdateFileStatusResponseUpdatefilestatus,
|
|
13
|
+
)
|
|
14
|
+
from ...types import Response
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _get_kwargs(
|
|
18
|
+
graph_id: str,
|
|
19
|
+
file_id: str,
|
|
20
|
+
*,
|
|
21
|
+
body: FileStatusUpdate,
|
|
22
|
+
) -> dict[str, Any]:
|
|
23
|
+
headers: dict[str, Any] = {}
|
|
24
|
+
|
|
25
|
+
_kwargs: dict[str, Any] = {
|
|
26
|
+
"method": "patch",
|
|
27
|
+
"url": f"/v1/graphs/{graph_id}/tables/files/{file_id}",
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
_kwargs["json"] = body.to_dict()
|
|
31
|
+
|
|
32
|
+
headers["Content-Type"] = "application/json"
|
|
33
|
+
|
|
34
|
+
_kwargs["headers"] = headers
|
|
35
|
+
return _kwargs
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _parse_response(
|
|
39
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
40
|
+
) -> Optional[
|
|
41
|
+
Union[
|
|
42
|
+
Any, ErrorResponse, HTTPValidationError, UpdateFileStatusResponseUpdatefilestatus
|
|
43
|
+
]
|
|
44
|
+
]:
|
|
45
|
+
if response.status_code == 200:
|
|
46
|
+
response_200 = UpdateFileStatusResponseUpdatefilestatus.from_dict(response.json())
|
|
47
|
+
|
|
48
|
+
return response_200
|
|
49
|
+
|
|
50
|
+
if response.status_code == 400:
|
|
51
|
+
response_400 = ErrorResponse.from_dict(response.json())
|
|
52
|
+
|
|
53
|
+
return response_400
|
|
54
|
+
|
|
55
|
+
if response.status_code == 401:
|
|
56
|
+
response_401 = cast(Any, None)
|
|
57
|
+
return response_401
|
|
58
|
+
|
|
59
|
+
if response.status_code == 403:
|
|
60
|
+
response_403 = ErrorResponse.from_dict(response.json())
|
|
61
|
+
|
|
62
|
+
return response_403
|
|
63
|
+
|
|
64
|
+
if response.status_code == 404:
|
|
65
|
+
response_404 = ErrorResponse.from_dict(response.json())
|
|
66
|
+
|
|
67
|
+
return response_404
|
|
68
|
+
|
|
69
|
+
if response.status_code == 413:
|
|
70
|
+
response_413 = ErrorResponse.from_dict(response.json())
|
|
71
|
+
|
|
72
|
+
return response_413
|
|
73
|
+
|
|
74
|
+
if response.status_code == 422:
|
|
75
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
76
|
+
|
|
77
|
+
return response_422
|
|
78
|
+
|
|
79
|
+
if response.status_code == 500:
|
|
80
|
+
response_500 = cast(Any, None)
|
|
81
|
+
return response_500
|
|
82
|
+
|
|
83
|
+
if client.raise_on_unexpected_status:
|
|
84
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
85
|
+
else:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def _build_response(
|
|
90
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
91
|
+
) -> Response[
|
|
92
|
+
Union[
|
|
93
|
+
Any, ErrorResponse, HTTPValidationError, UpdateFileStatusResponseUpdatefilestatus
|
|
94
|
+
]
|
|
95
|
+
]:
|
|
96
|
+
return Response(
|
|
97
|
+
status_code=HTTPStatus(response.status_code),
|
|
98
|
+
content=response.content,
|
|
99
|
+
headers=response.headers,
|
|
100
|
+
parsed=_parse_response(client=client, response=response),
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def sync_detailed(
|
|
105
|
+
graph_id: str,
|
|
106
|
+
file_id: str,
|
|
107
|
+
*,
|
|
108
|
+
client: AuthenticatedClient,
|
|
109
|
+
body: FileStatusUpdate,
|
|
110
|
+
) -> Response[
|
|
111
|
+
Union[
|
|
112
|
+
Any, ErrorResponse, HTTPValidationError, UpdateFileStatusResponseUpdatefilestatus
|
|
113
|
+
]
|
|
114
|
+
]:
|
|
115
|
+
"""Update File Upload Status
|
|
116
|
+
|
|
117
|
+
Update file status after upload completes.
|
|
118
|
+
|
|
119
|
+
Marks files as uploaded after successful S3 upload. The backend validates
|
|
120
|
+
the file, calculates size and row count, enforces storage limits, and
|
|
121
|
+
registers the DuckDB table for queries.
|
|
122
|
+
|
|
123
|
+
**Status Values:**
|
|
124
|
+
- `uploaded`: File successfully uploaded to S3 (triggers validation)
|
|
125
|
+
- `disabled`: Exclude file from ingestion
|
|
126
|
+
- `archived`: Soft delete file
|
|
127
|
+
|
|
128
|
+
**What Happens on 'uploaded' Status:**
|
|
129
|
+
1. Verify file exists in S3
|
|
130
|
+
2. Calculate actual file size
|
|
131
|
+
3. Enforce tier storage limits
|
|
132
|
+
4. Calculate or estimate row count
|
|
133
|
+
5. Update table statistics
|
|
134
|
+
6. Register DuckDB external table
|
|
135
|
+
7. File ready for ingestion
|
|
136
|
+
|
|
137
|
+
**Row Count Calculation:**
|
|
138
|
+
- **Parquet**: Exact count from file metadata
|
|
139
|
+
- **CSV**: Count rows (minus header)
|
|
140
|
+
- **JSON**: Count array elements
|
|
141
|
+
- **Fallback**: Estimate from file size if reading fails
|
|
142
|
+
|
|
143
|
+
**Storage Limits:**
|
|
144
|
+
Enforced per subscription tier. Returns HTTP 413 if limit exceeded.
|
|
145
|
+
Check current usage before large uploads.
|
|
146
|
+
|
|
147
|
+
**Important Notes:**
|
|
148
|
+
- Always call this after S3 upload completes
|
|
149
|
+
- Check response for actual row count
|
|
150
|
+
- Storage limit errors (413) mean tier upgrade needed
|
|
151
|
+
- DuckDB registration failures are non-fatal (retried later)
|
|
152
|
+
- Status updates are included - no credit consumption
|
|
153
|
+
|
|
154
|
+
Args:
|
|
155
|
+
graph_id (str):
|
|
156
|
+
file_id (str): File identifier
|
|
157
|
+
body (FileStatusUpdate):
|
|
158
|
+
|
|
159
|
+
Raises:
|
|
160
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
161
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
162
|
+
|
|
163
|
+
Returns:
|
|
164
|
+
Response[Union[Any, ErrorResponse, HTTPValidationError, UpdateFileStatusResponseUpdatefilestatus]]
|
|
165
|
+
"""
|
|
166
|
+
|
|
167
|
+
kwargs = _get_kwargs(
|
|
168
|
+
graph_id=graph_id,
|
|
169
|
+
file_id=file_id,
|
|
170
|
+
body=body,
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
response = client.get_httpx_client().request(
|
|
174
|
+
**kwargs,
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
return _build_response(client=client, response=response)
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
def sync(
|
|
181
|
+
graph_id: str,
|
|
182
|
+
file_id: str,
|
|
183
|
+
*,
|
|
184
|
+
client: AuthenticatedClient,
|
|
185
|
+
body: FileStatusUpdate,
|
|
186
|
+
) -> Optional[
|
|
187
|
+
Union[
|
|
188
|
+
Any, ErrorResponse, HTTPValidationError, UpdateFileStatusResponseUpdatefilestatus
|
|
189
|
+
]
|
|
190
|
+
]:
|
|
191
|
+
"""Update File Upload Status
|
|
192
|
+
|
|
193
|
+
Update file status after upload completes.
|
|
194
|
+
|
|
195
|
+
Marks files as uploaded after successful S3 upload. The backend validates
|
|
196
|
+
the file, calculates size and row count, enforces storage limits, and
|
|
197
|
+
registers the DuckDB table for queries.
|
|
198
|
+
|
|
199
|
+
**Status Values:**
|
|
200
|
+
- `uploaded`: File successfully uploaded to S3 (triggers validation)
|
|
201
|
+
- `disabled`: Exclude file from ingestion
|
|
202
|
+
- `archived`: Soft delete file
|
|
203
|
+
|
|
204
|
+
**What Happens on 'uploaded' Status:**
|
|
205
|
+
1. Verify file exists in S3
|
|
206
|
+
2. Calculate actual file size
|
|
207
|
+
3. Enforce tier storage limits
|
|
208
|
+
4. Calculate or estimate row count
|
|
209
|
+
5. Update table statistics
|
|
210
|
+
6. Register DuckDB external table
|
|
211
|
+
7. File ready for ingestion
|
|
212
|
+
|
|
213
|
+
**Row Count Calculation:**
|
|
214
|
+
- **Parquet**: Exact count from file metadata
|
|
215
|
+
- **CSV**: Count rows (minus header)
|
|
216
|
+
- **JSON**: Count array elements
|
|
217
|
+
- **Fallback**: Estimate from file size if reading fails
|
|
218
|
+
|
|
219
|
+
**Storage Limits:**
|
|
220
|
+
Enforced per subscription tier. Returns HTTP 413 if limit exceeded.
|
|
221
|
+
Check current usage before large uploads.
|
|
222
|
+
|
|
223
|
+
**Important Notes:**
|
|
224
|
+
- Always call this after S3 upload completes
|
|
225
|
+
- Check response for actual row count
|
|
226
|
+
- Storage limit errors (413) mean tier upgrade needed
|
|
227
|
+
- DuckDB registration failures are non-fatal (retried later)
|
|
228
|
+
- Status updates are included - no credit consumption
|
|
229
|
+
|
|
230
|
+
Args:
|
|
231
|
+
graph_id (str):
|
|
232
|
+
file_id (str): File identifier
|
|
233
|
+
body (FileStatusUpdate):
|
|
234
|
+
|
|
235
|
+
Raises:
|
|
236
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
237
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
238
|
+
|
|
239
|
+
Returns:
|
|
240
|
+
Union[Any, ErrorResponse, HTTPValidationError, UpdateFileStatusResponseUpdatefilestatus]
|
|
241
|
+
"""
|
|
242
|
+
|
|
243
|
+
return sync_detailed(
|
|
244
|
+
graph_id=graph_id,
|
|
245
|
+
file_id=file_id,
|
|
246
|
+
client=client,
|
|
247
|
+
body=body,
|
|
248
|
+
).parsed
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
async def asyncio_detailed(
|
|
252
|
+
graph_id: str,
|
|
253
|
+
file_id: str,
|
|
254
|
+
*,
|
|
255
|
+
client: AuthenticatedClient,
|
|
256
|
+
body: FileStatusUpdate,
|
|
257
|
+
) -> Response[
|
|
258
|
+
Union[
|
|
259
|
+
Any, ErrorResponse, HTTPValidationError, UpdateFileStatusResponseUpdatefilestatus
|
|
260
|
+
]
|
|
261
|
+
]:
|
|
262
|
+
"""Update File Upload Status
|
|
263
|
+
|
|
264
|
+
Update file status after upload completes.
|
|
265
|
+
|
|
266
|
+
Marks files as uploaded after successful S3 upload. The backend validates
|
|
267
|
+
the file, calculates size and row count, enforces storage limits, and
|
|
268
|
+
registers the DuckDB table for queries.
|
|
269
|
+
|
|
270
|
+
**Status Values:**
|
|
271
|
+
- `uploaded`: File successfully uploaded to S3 (triggers validation)
|
|
272
|
+
- `disabled`: Exclude file from ingestion
|
|
273
|
+
- `archived`: Soft delete file
|
|
274
|
+
|
|
275
|
+
**What Happens on 'uploaded' Status:**
|
|
276
|
+
1. Verify file exists in S3
|
|
277
|
+
2. Calculate actual file size
|
|
278
|
+
3. Enforce tier storage limits
|
|
279
|
+
4. Calculate or estimate row count
|
|
280
|
+
5. Update table statistics
|
|
281
|
+
6. Register DuckDB external table
|
|
282
|
+
7. File ready for ingestion
|
|
283
|
+
|
|
284
|
+
**Row Count Calculation:**
|
|
285
|
+
- **Parquet**: Exact count from file metadata
|
|
286
|
+
- **CSV**: Count rows (minus header)
|
|
287
|
+
- **JSON**: Count array elements
|
|
288
|
+
- **Fallback**: Estimate from file size if reading fails
|
|
289
|
+
|
|
290
|
+
**Storage Limits:**
|
|
291
|
+
Enforced per subscription tier. Returns HTTP 413 if limit exceeded.
|
|
292
|
+
Check current usage before large uploads.
|
|
293
|
+
|
|
294
|
+
**Important Notes:**
|
|
295
|
+
- Always call this after S3 upload completes
|
|
296
|
+
- Check response for actual row count
|
|
297
|
+
- Storage limit errors (413) mean tier upgrade needed
|
|
298
|
+
- DuckDB registration failures are non-fatal (retried later)
|
|
299
|
+
- Status updates are included - no credit consumption
|
|
300
|
+
|
|
301
|
+
Args:
|
|
302
|
+
graph_id (str):
|
|
303
|
+
file_id (str): File identifier
|
|
304
|
+
body (FileStatusUpdate):
|
|
305
|
+
|
|
306
|
+
Raises:
|
|
307
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
308
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
309
|
+
|
|
310
|
+
Returns:
|
|
311
|
+
Response[Union[Any, ErrorResponse, HTTPValidationError, UpdateFileStatusResponseUpdatefilestatus]]
|
|
312
|
+
"""
|
|
313
|
+
|
|
314
|
+
kwargs = _get_kwargs(
|
|
315
|
+
graph_id=graph_id,
|
|
316
|
+
file_id=file_id,
|
|
317
|
+
body=body,
|
|
318
|
+
)
|
|
319
|
+
|
|
320
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
321
|
+
|
|
322
|
+
return _build_response(client=client, response=response)
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
async def asyncio(
|
|
326
|
+
graph_id: str,
|
|
327
|
+
file_id: str,
|
|
328
|
+
*,
|
|
329
|
+
client: AuthenticatedClient,
|
|
330
|
+
body: FileStatusUpdate,
|
|
331
|
+
) -> Optional[
|
|
332
|
+
Union[
|
|
333
|
+
Any, ErrorResponse, HTTPValidationError, UpdateFileStatusResponseUpdatefilestatus
|
|
334
|
+
]
|
|
335
|
+
]:
|
|
336
|
+
"""Update File Upload Status
|
|
337
|
+
|
|
338
|
+
Update file status after upload completes.
|
|
339
|
+
|
|
340
|
+
Marks files as uploaded after successful S3 upload. The backend validates
|
|
341
|
+
the file, calculates size and row count, enforces storage limits, and
|
|
342
|
+
registers the DuckDB table for queries.
|
|
343
|
+
|
|
344
|
+
**Status Values:**
|
|
345
|
+
- `uploaded`: File successfully uploaded to S3 (triggers validation)
|
|
346
|
+
- `disabled`: Exclude file from ingestion
|
|
347
|
+
- `archived`: Soft delete file
|
|
348
|
+
|
|
349
|
+
**What Happens on 'uploaded' Status:**
|
|
350
|
+
1. Verify file exists in S3
|
|
351
|
+
2. Calculate actual file size
|
|
352
|
+
3. Enforce tier storage limits
|
|
353
|
+
4. Calculate or estimate row count
|
|
354
|
+
5. Update table statistics
|
|
355
|
+
6. Register DuckDB external table
|
|
356
|
+
7. File ready for ingestion
|
|
357
|
+
|
|
358
|
+
**Row Count Calculation:**
|
|
359
|
+
- **Parquet**: Exact count from file metadata
|
|
360
|
+
- **CSV**: Count rows (minus header)
|
|
361
|
+
- **JSON**: Count array elements
|
|
362
|
+
- **Fallback**: Estimate from file size if reading fails
|
|
363
|
+
|
|
364
|
+
**Storage Limits:**
|
|
365
|
+
Enforced per subscription tier. Returns HTTP 413 if limit exceeded.
|
|
366
|
+
Check current usage before large uploads.
|
|
367
|
+
|
|
368
|
+
**Important Notes:**
|
|
369
|
+
- Always call this after S3 upload completes
|
|
370
|
+
- Check response for actual row count
|
|
371
|
+
- Storage limit errors (413) mean tier upgrade needed
|
|
372
|
+
- DuckDB registration failures are non-fatal (retried later)
|
|
373
|
+
- Status updates are included - no credit consumption
|
|
374
|
+
|
|
375
|
+
Args:
|
|
376
|
+
graph_id (str):
|
|
377
|
+
file_id (str): File identifier
|
|
378
|
+
body (FileStatusUpdate):
|
|
379
|
+
|
|
380
|
+
Raises:
|
|
381
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
382
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
383
|
+
|
|
384
|
+
Returns:
|
|
385
|
+
Union[Any, ErrorResponse, HTTPValidationError, UpdateFileStatusResponseUpdatefilestatus]
|
|
386
|
+
"""
|
|
387
|
+
|
|
388
|
+
return (
|
|
389
|
+
await asyncio_detailed(
|
|
390
|
+
graph_id=graph_id,
|
|
391
|
+
file_id=file_id,
|
|
392
|
+
client=client,
|
|
393
|
+
body=body,
|
|
394
|
+
)
|
|
395
|
+
).parsed
|
|
@@ -8,34 +8,18 @@ from ...client import AuthenticatedClient, Client
|
|
|
8
8
|
from ...models.create_api_key_request import CreateAPIKeyRequest
|
|
9
9
|
from ...models.create_api_key_response import CreateAPIKeyResponse
|
|
10
10
|
from ...models.http_validation_error import HTTPValidationError
|
|
11
|
-
from ...types import
|
|
11
|
+
from ...types import Response
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
def _get_kwargs(
|
|
15
15
|
*,
|
|
16
16
|
body: CreateAPIKeyRequest,
|
|
17
|
-
token: Union[None, Unset, str] = UNSET,
|
|
18
|
-
authorization: Union[None, Unset, str] = UNSET,
|
|
19
17
|
) -> dict[str, Any]:
|
|
20
18
|
headers: dict[str, Any] = {}
|
|
21
|
-
if not isinstance(authorization, Unset):
|
|
22
|
-
headers["authorization"] = authorization
|
|
23
|
-
|
|
24
|
-
params: dict[str, Any] = {}
|
|
25
|
-
|
|
26
|
-
json_token: Union[None, Unset, str]
|
|
27
|
-
if isinstance(token, Unset):
|
|
28
|
-
json_token = UNSET
|
|
29
|
-
else:
|
|
30
|
-
json_token = token
|
|
31
|
-
params["token"] = json_token
|
|
32
|
-
|
|
33
|
-
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
34
19
|
|
|
35
20
|
_kwargs: dict[str, Any] = {
|
|
36
21
|
"method": "post",
|
|
37
22
|
"url": "/v1/user/api-keys",
|
|
38
|
-
"params": params,
|
|
39
23
|
}
|
|
40
24
|
|
|
41
25
|
_kwargs["json"] = body.to_dict()
|
|
@@ -80,16 +64,12 @@ def sync_detailed(
|
|
|
80
64
|
*,
|
|
81
65
|
client: AuthenticatedClient,
|
|
82
66
|
body: CreateAPIKeyRequest,
|
|
83
|
-
token: Union[None, Unset, str] = UNSET,
|
|
84
|
-
authorization: Union[None, Unset, str] = UNSET,
|
|
85
67
|
) -> Response[Union[CreateAPIKeyResponse, HTTPValidationError]]:
|
|
86
68
|
"""Create API Key
|
|
87
69
|
|
|
88
70
|
Create a new API key for the current user.
|
|
89
71
|
|
|
90
72
|
Args:
|
|
91
|
-
token (Union[None, Unset, str]): JWT token for SSE authentication
|
|
92
|
-
authorization (Union[None, Unset, str]):
|
|
93
73
|
body (CreateAPIKeyRequest): Request model for creating a new API key.
|
|
94
74
|
|
|
95
75
|
Raises:
|
|
@@ -102,8 +82,6 @@ def sync_detailed(
|
|
|
102
82
|
|
|
103
83
|
kwargs = _get_kwargs(
|
|
104
84
|
body=body,
|
|
105
|
-
token=token,
|
|
106
|
-
authorization=authorization,
|
|
107
85
|
)
|
|
108
86
|
|
|
109
87
|
response = client.get_httpx_client().request(
|
|
@@ -117,16 +95,12 @@ def sync(
|
|
|
117
95
|
*,
|
|
118
96
|
client: AuthenticatedClient,
|
|
119
97
|
body: CreateAPIKeyRequest,
|
|
120
|
-
token: Union[None, Unset, str] = UNSET,
|
|
121
|
-
authorization: Union[None, Unset, str] = UNSET,
|
|
122
98
|
) -> Optional[Union[CreateAPIKeyResponse, HTTPValidationError]]:
|
|
123
99
|
"""Create API Key
|
|
124
100
|
|
|
125
101
|
Create a new API key for the current user.
|
|
126
102
|
|
|
127
103
|
Args:
|
|
128
|
-
token (Union[None, Unset, str]): JWT token for SSE authentication
|
|
129
|
-
authorization (Union[None, Unset, str]):
|
|
130
104
|
body (CreateAPIKeyRequest): Request model for creating a new API key.
|
|
131
105
|
|
|
132
106
|
Raises:
|
|
@@ -140,8 +114,6 @@ def sync(
|
|
|
140
114
|
return sync_detailed(
|
|
141
115
|
client=client,
|
|
142
116
|
body=body,
|
|
143
|
-
token=token,
|
|
144
|
-
authorization=authorization,
|
|
145
117
|
).parsed
|
|
146
118
|
|
|
147
119
|
|
|
@@ -149,16 +121,12 @@ async def asyncio_detailed(
|
|
|
149
121
|
*,
|
|
150
122
|
client: AuthenticatedClient,
|
|
151
123
|
body: CreateAPIKeyRequest,
|
|
152
|
-
token: Union[None, Unset, str] = UNSET,
|
|
153
|
-
authorization: Union[None, Unset, str] = UNSET,
|
|
154
124
|
) -> Response[Union[CreateAPIKeyResponse, HTTPValidationError]]:
|
|
155
125
|
"""Create API Key
|
|
156
126
|
|
|
157
127
|
Create a new API key for the current user.
|
|
158
128
|
|
|
159
129
|
Args:
|
|
160
|
-
token (Union[None, Unset, str]): JWT token for SSE authentication
|
|
161
|
-
authorization (Union[None, Unset, str]):
|
|
162
130
|
body (CreateAPIKeyRequest): Request model for creating a new API key.
|
|
163
131
|
|
|
164
132
|
Raises:
|
|
@@ -171,8 +139,6 @@ async def asyncio_detailed(
|
|
|
171
139
|
|
|
172
140
|
kwargs = _get_kwargs(
|
|
173
141
|
body=body,
|
|
174
|
-
token=token,
|
|
175
|
-
authorization=authorization,
|
|
176
142
|
)
|
|
177
143
|
|
|
178
144
|
response = await client.get_async_httpx_client().request(**kwargs)
|
|
@@ -184,16 +150,12 @@ async def asyncio(
|
|
|
184
150
|
*,
|
|
185
151
|
client: AuthenticatedClient,
|
|
186
152
|
body: CreateAPIKeyRequest,
|
|
187
|
-
token: Union[None, Unset, str] = UNSET,
|
|
188
|
-
authorization: Union[None, Unset, str] = UNSET,
|
|
189
153
|
) -> Optional[Union[CreateAPIKeyResponse, HTTPValidationError]]:
|
|
190
154
|
"""Create API Key
|
|
191
155
|
|
|
192
156
|
Create a new API key for the current user.
|
|
193
157
|
|
|
194
158
|
Args:
|
|
195
|
-
token (Union[None, Unset, str]): JWT token for SSE authentication
|
|
196
|
-
authorization (Union[None, Unset, str]):
|
|
197
159
|
body (CreateAPIKeyRequest): Request model for creating a new API key.
|
|
198
160
|
|
|
199
161
|
Raises:
|
|
@@ -208,7 +170,5 @@ async def asyncio(
|
|
|
208
170
|
await asyncio_detailed(
|
|
209
171
|
client=client,
|
|
210
172
|
body=body,
|
|
211
|
-
token=token,
|
|
212
|
-
authorization=authorization,
|
|
213
173
|
)
|
|
214
174
|
).parsed
|