data_store
Data Store client for browsing files and folders in store connectors.
Initialize the DataStore client.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request_handler
|
RequestHandler
|
The request handler for making API calls |
required |
Source code in airia/client/data_store/sync_data_store.py
store = Store(request_handler)
instance-attribute
data_store.store
Bases: BaseStore
Store client for browsing files and folders.
Source code in airia/client/data_store/store/sync_store.py
get_files_and_folders(store_connector_id, project_id, folder_id=None, page_number=None, page_size=None, sort_by=None, sort_order=None, filter_by=None, filter_value=None, correlation_id=None)
Retrieve files and folders from a store connector in the Airia data store.
This method retrieves information about files and folders in the specified store connector, with optional navigation into specific folders and support for pagination, sorting, and filtering.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
store_connector_id
|
str
|
The unique identifier of the store connector (GUID format) |
required |
project_id
|
str
|
The unique identifier of the project (GUID format) |
required |
folder_id
|
Optional[str]
|
Optional folder ID to browse within a specific folder (GUID format). If not provided, retrieves items from the root level. |
None
|
page_number
|
Optional[int]
|
Page number for pagination (1-indexed) |
None
|
page_size
|
Optional[int]
|
Number of items per page |
None
|
sort_by
|
Optional[str]
|
Field to sort by (e.g., "lastSyncAt", "name") |
None
|
sort_order
|
Optional[str]
|
Sort order ("ASC" or "DESC") |
None
|
filter_by
|
Optional[str]
|
Field to filter by |
None
|
filter_value
|
Optional[str]
|
Value to filter by |
None
|
correlation_id
|
Optional[str]
|
Optional correlation ID for request tracing |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
GetFilesAndFoldersResponse |
GetFilesAndFoldersResponse
|
List of files and folders with metadata and total count |
Raises:
| Type | Description |
|---|---|
AiriaAPIError
|
If the API request fails, including cases where: - The store_connector_id doesn't exist (404) - The project_id doesn't exist (404) - The folder_id is invalid (404) - Authentication fails (401) - Access is forbidden (403) - Server errors (5xx) |
ValueError
|
If required parameters are missing or invalid |
Example
from airia import AiriaClient
client = AiriaClient(api_key="your_api_key")
# Get files and folders from root level
response = client.data_store.store.get_files_and_folders(
store_connector_id="02b2ef8b-8bff-42c3-9ddb-e325c893176e",
project_id="0196162b-1553-71b2-8ebf-44594717936e"
)
# Browse a specific folder with pagination and sorting
response = client.data_store.store.get_files_and_folders(
store_connector_id="02b2ef8b-8bff-42c3-9ddb-e325c893176e",
project_id="0196162b-1553-71b2-8ebf-44594717936e",
folder_id="3292db69-f365-4bb6-a2b6-a017a187fb77",
page_number=1,
page_size=50,
sort_by="lastSyncAt",
sort_order="DESC"
)
# Access the results
if response.files_and_folders:
for item in response.files_and_folders:
print(f"{item.name} ({item.type})")
if item.type == "folder":
print(f" Contains {item.file_count} files, {item.folder_count} folders")
print(f"Total items: {response.total_count}")
Note
The response includes: - files_and_folders: List of file and folder objects with metadata - total_count: Total number of items (useful for pagination)
Source code in airia/client/data_store/store/sync_store.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | |