robosystems-client 0.2.1__py3-none-any.whl → 0.2.3__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.

Files changed (36) hide show
  1. robosystems_client/api/tables/delete_file.py +437 -0
  2. robosystems_client/api/tables/get_file_info.py +397 -0
  3. robosystems_client/api/tables/get_upload_url.py +548 -0
  4. robosystems_client/api/tables/ingest_tables.py +616 -0
  5. robosystems_client/api/tables/list_table_files.py +509 -0
  6. robosystems_client/api/tables/list_tables.py +488 -0
  7. robosystems_client/api/tables/query_tables.py +487 -0
  8. robosystems_client/api/tables/update_file_status.py +539 -0
  9. robosystems_client/extensions/__init__.py +11 -0
  10. robosystems_client/extensions/extensions.py +3 -0
  11. robosystems_client/extensions/graph_client.py +326 -0
  12. robosystems_client/extensions/query_client.py +74 -1
  13. robosystems_client/extensions/table_ingest_client.py +31 -40
  14. robosystems_client/models/__init__.py +13 -17
  15. robosystems_client/models/create_graph_request.py +11 -0
  16. 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
  17. robosystems_client/models/file_info.py +169 -0
  18. robosystems_client/models/file_status_update.py +41 -0
  19. robosystems_client/models/get_file_info_response.py +205 -0
  20. robosystems_client/models/list_table_files_response.py +105 -0
  21. 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
  22. {robosystems_client-0.2.1.dist-info → robosystems_client-0.2.3.dist-info}/METADATA +1 -1
  23. {robosystems_client-0.2.1.dist-info → robosystems_client-0.2.3.dist-info}/RECORD +25 -23
  24. robosystems_client/api/tables/delete_file_v1_graphs_graph_id_tables_files_file_id_delete.py +0 -287
  25. robosystems_client/api/tables/get_file_info_v1_graphs_graph_id_tables_files_file_id_get.py +0 -283
  26. robosystems_client/api/tables/get_upload_url_v1_graphs_graph_id_tables_table_name_files_post.py +0 -260
  27. robosystems_client/api/tables/ingest_tables_v1_graphs_graph_id_tables_ingest_post.py +0 -251
  28. robosystems_client/api/tables/list_table_files_v1_graphs_graph_id_tables_table_name_files_get.py +0 -283
  29. robosystems_client/api/tables/list_tables_v1_graphs_graph_id_tables_get.py +0 -224
  30. robosystems_client/api/tables/query_tables_v1_graphs_graph_id_tables_query_post.py +0 -247
  31. robosystems_client/api/tables/update_file_v1_graphs_graph_id_tables_files_file_id_patch.py +0 -306
  32. robosystems_client/models/file_update_request.py +0 -62
  33. 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
  34. 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
  35. {robosystems_client-0.2.1.dist-info → robosystems_client-0.2.3.dist-info}/WHEEL +0 -0
  36. {robosystems_client-0.2.1.dist-info → robosystems_client-0.2.3.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,509 @@
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.http_validation_error import HTTPValidationError
10
+ from ...models.list_table_files_response import ListTableFilesResponse
11
+ from ...types import UNSET, Response, Unset
12
+
13
+
14
+ def _get_kwargs(
15
+ graph_id: str,
16
+ table_name: str,
17
+ *,
18
+ token: Union[None, Unset, str] = UNSET,
19
+ authorization: Union[None, Unset, str] = UNSET,
20
+ ) -> dict[str, Any]:
21
+ headers: dict[str, Any] = {}
22
+ if not isinstance(authorization, Unset):
23
+ headers["authorization"] = authorization
24
+
25
+ params: dict[str, Any] = {}
26
+
27
+ json_token: Union[None, Unset, str]
28
+ if isinstance(token, Unset):
29
+ json_token = UNSET
30
+ else:
31
+ json_token = token
32
+ params["token"] = json_token
33
+
34
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
35
+
36
+ _kwargs: dict[str, Any] = {
37
+ "method": "get",
38
+ "url": f"/v1/graphs/{graph_id}/tables/{table_name}/files",
39
+ "params": params,
40
+ }
41
+
42
+ _kwargs["headers"] = headers
43
+ return _kwargs
44
+
45
+
46
+ def _parse_response(
47
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
48
+ ) -> Optional[Union[Any, ErrorResponse, HTTPValidationError, ListTableFilesResponse]]:
49
+ if response.status_code == 200:
50
+ response_200 = ListTableFilesResponse.from_dict(response.json())
51
+
52
+ return response_200
53
+
54
+ if response.status_code == 401:
55
+ response_401 = cast(Any, None)
56
+ return response_401
57
+
58
+ if response.status_code == 403:
59
+ response_403 = ErrorResponse.from_dict(response.json())
60
+
61
+ return response_403
62
+
63
+ if response.status_code == 404:
64
+ response_404 = ErrorResponse.from_dict(response.json())
65
+
66
+ return response_404
67
+
68
+ if response.status_code == 422:
69
+ response_422 = HTTPValidationError.from_dict(response.json())
70
+
71
+ return response_422
72
+
73
+ if response.status_code == 500:
74
+ response_500 = cast(Any, None)
75
+ return response_500
76
+
77
+ if client.raise_on_unexpected_status:
78
+ raise errors.UnexpectedStatus(response.status_code, response.content)
79
+ else:
80
+ return None
81
+
82
+
83
+ def _build_response(
84
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
85
+ ) -> Response[Union[Any, ErrorResponse, HTTPValidationError, ListTableFilesResponse]]:
86
+ return Response(
87
+ status_code=HTTPStatus(response.status_code),
88
+ content=response.content,
89
+ headers=response.headers,
90
+ parsed=_parse_response(client=client, response=response),
91
+ )
92
+
93
+
94
+ def sync_detailed(
95
+ graph_id: str,
96
+ table_name: str,
97
+ *,
98
+ client: AuthenticatedClient,
99
+ token: Union[None, Unset, str] = UNSET,
100
+ authorization: Union[None, Unset, str] = UNSET,
101
+ ) -> Response[Union[Any, ErrorResponse, HTTPValidationError, ListTableFilesResponse]]:
102
+ r""" List Files in Staging Table
103
+
104
+ List all files uploaded to a staging table with comprehensive metadata.
105
+
106
+ **Purpose:**
107
+ Get a complete inventory of all files in a staging table, including upload status,
108
+ file sizes, row counts, and S3 locations. Essential for monitoring upload progress
109
+ and validating data before ingestion.
110
+
111
+ **Use Cases:**
112
+ - Monitor file upload progress
113
+ - Verify files are ready for ingestion
114
+ - Check file formats and sizes
115
+ - Track storage usage per table
116
+ - Identify failed or incomplete uploads
117
+ - Pre-ingestion validation
118
+
119
+ **What You Get:**
120
+ - File ID and name
121
+ - File format (parquet, csv, etc.)
122
+ - Size in bytes
123
+ - Row count (if available)
124
+ - Upload status and method
125
+ - Creation and upload timestamps
126
+ - S3 key for reference
127
+
128
+ **Upload Status Values:**
129
+ - `created`: File record created, not yet uploaded
130
+ - `uploading`: Upload in progress
131
+ - `uploaded`: Successfully uploaded, ready for ingestion
132
+ - `failed`: Upload failed
133
+
134
+ **Example Response:**
135
+ ```json
136
+ {
137
+ \"graph_id\": \"kg123\",
138
+ \"table_name\": \"Entity\",
139
+ \"files\": [
140
+ {
141
+ \"file_id\": \"f123\",
142
+ \"file_name\": \"entities_batch1.parquet\",
143
+ \"file_format\": \"parquet\",
144
+ \"size_bytes\": 1048576,
145
+ \"row_count\": 5000,
146
+ \"upload_status\": \"uploaded\",
147
+ \"upload_method\": \"presigned_url\",
148
+ \"created_at\": \"2025-10-28T10:00:00Z\",
149
+ \"uploaded_at\": \"2025-10-28T10:01:30Z\",
150
+ \"s3_key\": \"user-staging/user123/kg123/Entity/entities_batch1.parquet\"
151
+ }
152
+ ],
153
+ \"total_files\": 1,
154
+ \"total_size_bytes\": 1048576
155
+ }
156
+ ```
157
+
158
+ **Example Usage:**
159
+ ```bash
160
+ curl -H \"Authorization: Bearer YOUR_TOKEN\" \
161
+ https://api.robosystems.ai/v1/graphs/kg123/tables/Entity/files
162
+ ```
163
+
164
+ **Tips:**
165
+ - Only `uploaded` files are ingested
166
+ - Check `row_count` to estimate data volume
167
+ - Use `total_size_bytes` for storage monitoring
168
+ - Files with `failed` status should be deleted and re-uploaded
169
+
170
+ **Note:**
171
+ File listing is included - no credit consumption.
172
+
173
+ Args:
174
+ graph_id (str): Graph database identifier
175
+ table_name (str): Table name
176
+ token (Union[None, Unset, str]): JWT token for SSE authentication
177
+ authorization (Union[None, Unset, str]):
178
+
179
+ Raises:
180
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
181
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
182
+
183
+ Returns:
184
+ Response[Union[Any, ErrorResponse, HTTPValidationError, ListTableFilesResponse]]
185
+ """
186
+
187
+ kwargs = _get_kwargs(
188
+ graph_id=graph_id,
189
+ table_name=table_name,
190
+ token=token,
191
+ authorization=authorization,
192
+ )
193
+
194
+ response = client.get_httpx_client().request(
195
+ **kwargs,
196
+ )
197
+
198
+ return _build_response(client=client, response=response)
199
+
200
+
201
+ def sync(
202
+ graph_id: str,
203
+ table_name: str,
204
+ *,
205
+ client: AuthenticatedClient,
206
+ token: Union[None, Unset, str] = UNSET,
207
+ authorization: Union[None, Unset, str] = UNSET,
208
+ ) -> Optional[Union[Any, ErrorResponse, HTTPValidationError, ListTableFilesResponse]]:
209
+ r""" List Files in Staging Table
210
+
211
+ List all files uploaded to a staging table with comprehensive metadata.
212
+
213
+ **Purpose:**
214
+ Get a complete inventory of all files in a staging table, including upload status,
215
+ file sizes, row counts, and S3 locations. Essential for monitoring upload progress
216
+ and validating data before ingestion.
217
+
218
+ **Use Cases:**
219
+ - Monitor file upload progress
220
+ - Verify files are ready for ingestion
221
+ - Check file formats and sizes
222
+ - Track storage usage per table
223
+ - Identify failed or incomplete uploads
224
+ - Pre-ingestion validation
225
+
226
+ **What You Get:**
227
+ - File ID and name
228
+ - File format (parquet, csv, etc.)
229
+ - Size in bytes
230
+ - Row count (if available)
231
+ - Upload status and method
232
+ - Creation and upload timestamps
233
+ - S3 key for reference
234
+
235
+ **Upload Status Values:**
236
+ - `created`: File record created, not yet uploaded
237
+ - `uploading`: Upload in progress
238
+ - `uploaded`: Successfully uploaded, ready for ingestion
239
+ - `failed`: Upload failed
240
+
241
+ **Example Response:**
242
+ ```json
243
+ {
244
+ \"graph_id\": \"kg123\",
245
+ \"table_name\": \"Entity\",
246
+ \"files\": [
247
+ {
248
+ \"file_id\": \"f123\",
249
+ \"file_name\": \"entities_batch1.parquet\",
250
+ \"file_format\": \"parquet\",
251
+ \"size_bytes\": 1048576,
252
+ \"row_count\": 5000,
253
+ \"upload_status\": \"uploaded\",
254
+ \"upload_method\": \"presigned_url\",
255
+ \"created_at\": \"2025-10-28T10:00:00Z\",
256
+ \"uploaded_at\": \"2025-10-28T10:01:30Z\",
257
+ \"s3_key\": \"user-staging/user123/kg123/Entity/entities_batch1.parquet\"
258
+ }
259
+ ],
260
+ \"total_files\": 1,
261
+ \"total_size_bytes\": 1048576
262
+ }
263
+ ```
264
+
265
+ **Example Usage:**
266
+ ```bash
267
+ curl -H \"Authorization: Bearer YOUR_TOKEN\" \
268
+ https://api.robosystems.ai/v1/graphs/kg123/tables/Entity/files
269
+ ```
270
+
271
+ **Tips:**
272
+ - Only `uploaded` files are ingested
273
+ - Check `row_count` to estimate data volume
274
+ - Use `total_size_bytes` for storage monitoring
275
+ - Files with `failed` status should be deleted and re-uploaded
276
+
277
+ **Note:**
278
+ File listing is included - no credit consumption.
279
+
280
+ Args:
281
+ graph_id (str): Graph database identifier
282
+ table_name (str): Table name
283
+ token (Union[None, Unset, str]): JWT token for SSE authentication
284
+ authorization (Union[None, Unset, str]):
285
+
286
+ Raises:
287
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
288
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
289
+
290
+ Returns:
291
+ Union[Any, ErrorResponse, HTTPValidationError, ListTableFilesResponse]
292
+ """
293
+
294
+ return sync_detailed(
295
+ graph_id=graph_id,
296
+ table_name=table_name,
297
+ client=client,
298
+ token=token,
299
+ authorization=authorization,
300
+ ).parsed
301
+
302
+
303
+ async def asyncio_detailed(
304
+ graph_id: str,
305
+ table_name: str,
306
+ *,
307
+ client: AuthenticatedClient,
308
+ token: Union[None, Unset, str] = UNSET,
309
+ authorization: Union[None, Unset, str] = UNSET,
310
+ ) -> Response[Union[Any, ErrorResponse, HTTPValidationError, ListTableFilesResponse]]:
311
+ r""" List Files in Staging Table
312
+
313
+ List all files uploaded to a staging table with comprehensive metadata.
314
+
315
+ **Purpose:**
316
+ Get a complete inventory of all files in a staging table, including upload status,
317
+ file sizes, row counts, and S3 locations. Essential for monitoring upload progress
318
+ and validating data before ingestion.
319
+
320
+ **Use Cases:**
321
+ - Monitor file upload progress
322
+ - Verify files are ready for ingestion
323
+ - Check file formats and sizes
324
+ - Track storage usage per table
325
+ - Identify failed or incomplete uploads
326
+ - Pre-ingestion validation
327
+
328
+ **What You Get:**
329
+ - File ID and name
330
+ - File format (parquet, csv, etc.)
331
+ - Size in bytes
332
+ - Row count (if available)
333
+ - Upload status and method
334
+ - Creation and upload timestamps
335
+ - S3 key for reference
336
+
337
+ **Upload Status Values:**
338
+ - `created`: File record created, not yet uploaded
339
+ - `uploading`: Upload in progress
340
+ - `uploaded`: Successfully uploaded, ready for ingestion
341
+ - `failed`: Upload failed
342
+
343
+ **Example Response:**
344
+ ```json
345
+ {
346
+ \"graph_id\": \"kg123\",
347
+ \"table_name\": \"Entity\",
348
+ \"files\": [
349
+ {
350
+ \"file_id\": \"f123\",
351
+ \"file_name\": \"entities_batch1.parquet\",
352
+ \"file_format\": \"parquet\",
353
+ \"size_bytes\": 1048576,
354
+ \"row_count\": 5000,
355
+ \"upload_status\": \"uploaded\",
356
+ \"upload_method\": \"presigned_url\",
357
+ \"created_at\": \"2025-10-28T10:00:00Z\",
358
+ \"uploaded_at\": \"2025-10-28T10:01:30Z\",
359
+ \"s3_key\": \"user-staging/user123/kg123/Entity/entities_batch1.parquet\"
360
+ }
361
+ ],
362
+ \"total_files\": 1,
363
+ \"total_size_bytes\": 1048576
364
+ }
365
+ ```
366
+
367
+ **Example Usage:**
368
+ ```bash
369
+ curl -H \"Authorization: Bearer YOUR_TOKEN\" \
370
+ https://api.robosystems.ai/v1/graphs/kg123/tables/Entity/files
371
+ ```
372
+
373
+ **Tips:**
374
+ - Only `uploaded` files are ingested
375
+ - Check `row_count` to estimate data volume
376
+ - Use `total_size_bytes` for storage monitoring
377
+ - Files with `failed` status should be deleted and re-uploaded
378
+
379
+ **Note:**
380
+ File listing is included - no credit consumption.
381
+
382
+ Args:
383
+ graph_id (str): Graph database identifier
384
+ table_name (str): Table name
385
+ token (Union[None, Unset, str]): JWT token for SSE authentication
386
+ authorization (Union[None, Unset, str]):
387
+
388
+ Raises:
389
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
390
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
391
+
392
+ Returns:
393
+ Response[Union[Any, ErrorResponse, HTTPValidationError, ListTableFilesResponse]]
394
+ """
395
+
396
+ kwargs = _get_kwargs(
397
+ graph_id=graph_id,
398
+ table_name=table_name,
399
+ token=token,
400
+ authorization=authorization,
401
+ )
402
+
403
+ response = await client.get_async_httpx_client().request(**kwargs)
404
+
405
+ return _build_response(client=client, response=response)
406
+
407
+
408
+ async def asyncio(
409
+ graph_id: str,
410
+ table_name: str,
411
+ *,
412
+ client: AuthenticatedClient,
413
+ token: Union[None, Unset, str] = UNSET,
414
+ authorization: Union[None, Unset, str] = UNSET,
415
+ ) -> Optional[Union[Any, ErrorResponse, HTTPValidationError, ListTableFilesResponse]]:
416
+ r""" List Files in Staging Table
417
+
418
+ List all files uploaded to a staging table with comprehensive metadata.
419
+
420
+ **Purpose:**
421
+ Get a complete inventory of all files in a staging table, including upload status,
422
+ file sizes, row counts, and S3 locations. Essential for monitoring upload progress
423
+ and validating data before ingestion.
424
+
425
+ **Use Cases:**
426
+ - Monitor file upload progress
427
+ - Verify files are ready for ingestion
428
+ - Check file formats and sizes
429
+ - Track storage usage per table
430
+ - Identify failed or incomplete uploads
431
+ - Pre-ingestion validation
432
+
433
+ **What You Get:**
434
+ - File ID and name
435
+ - File format (parquet, csv, etc.)
436
+ - Size in bytes
437
+ - Row count (if available)
438
+ - Upload status and method
439
+ - Creation and upload timestamps
440
+ - S3 key for reference
441
+
442
+ **Upload Status Values:**
443
+ - `created`: File record created, not yet uploaded
444
+ - `uploading`: Upload in progress
445
+ - `uploaded`: Successfully uploaded, ready for ingestion
446
+ - `failed`: Upload failed
447
+
448
+ **Example Response:**
449
+ ```json
450
+ {
451
+ \"graph_id\": \"kg123\",
452
+ \"table_name\": \"Entity\",
453
+ \"files\": [
454
+ {
455
+ \"file_id\": \"f123\",
456
+ \"file_name\": \"entities_batch1.parquet\",
457
+ \"file_format\": \"parquet\",
458
+ \"size_bytes\": 1048576,
459
+ \"row_count\": 5000,
460
+ \"upload_status\": \"uploaded\",
461
+ \"upload_method\": \"presigned_url\",
462
+ \"created_at\": \"2025-10-28T10:00:00Z\",
463
+ \"uploaded_at\": \"2025-10-28T10:01:30Z\",
464
+ \"s3_key\": \"user-staging/user123/kg123/Entity/entities_batch1.parquet\"
465
+ }
466
+ ],
467
+ \"total_files\": 1,
468
+ \"total_size_bytes\": 1048576
469
+ }
470
+ ```
471
+
472
+ **Example Usage:**
473
+ ```bash
474
+ curl -H \"Authorization: Bearer YOUR_TOKEN\" \
475
+ https://api.robosystems.ai/v1/graphs/kg123/tables/Entity/files
476
+ ```
477
+
478
+ **Tips:**
479
+ - Only `uploaded` files are ingested
480
+ - Check `row_count` to estimate data volume
481
+ - Use `total_size_bytes` for storage monitoring
482
+ - Files with `failed` status should be deleted and re-uploaded
483
+
484
+ **Note:**
485
+ File listing is included - no credit consumption.
486
+
487
+ Args:
488
+ graph_id (str): Graph database identifier
489
+ table_name (str): Table name
490
+ token (Union[None, Unset, str]): JWT token for SSE authentication
491
+ authorization (Union[None, Unset, str]):
492
+
493
+ Raises:
494
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
495
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
496
+
497
+ Returns:
498
+ Union[Any, ErrorResponse, HTTPValidationError, ListTableFilesResponse]
499
+ """
500
+
501
+ return (
502
+ await asyncio_detailed(
503
+ graph_id=graph_id,
504
+ table_name=table_name,
505
+ client=client,
506
+ token=token,
507
+ authorization=authorization,
508
+ )
509
+ ).parsed