store
Bases: BaseStore
Source code in airia/client/store/sync_store.py
delete_file(project_id, file_id, correlation_id=None)
Delete a file from the Airia store.
This method deletes a specific file from the given project.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_id
|
str
|
The unique identifier of the project (GUID format) |
required |
file_id
|
str
|
The unique identifier of the file to delete (GUID format) |
required |
correlation_id
|
Optional[str]
|
Optional correlation ID for request tracing |
None
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Raises:
| Type | Description |
|---|---|
AiriaAPIError
|
If the API request fails, including cases where: - The project_id doesn't exist (404) - The file_id doesn't exist (404) - Authentication fails (401) - Access is forbidden (403) - Server errors (5xx) |
ValueError
|
If required parameters are missing or invalid |
Example
Source code in airia/client/store/sync_store.py
get_file(project_id, file_id, correlation_id=None)
Retrieve a file from the Airia store.
This method retrieves file information, download URL, and preview information for a specific file in the given project.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_id
|
str
|
The unique identifier of the project (GUID format) |
required |
file_id
|
str
|
The unique identifier of the file (GUID format) |
required |
correlation_id
|
Optional[str]
|
Optional correlation ID for request tracing |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
GetFileResponse |
GetFileResponse
|
File information including metadata, download info, and preview info |
Raises:
| Type | Description |
|---|---|
AiriaAPIError
|
If the API request fails, including cases where: - The project_id doesn't exist (404) - The file_id doesn't exist (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 file information
file_info = client.store.get_file(
project_id="your_project_id",
file_id="your_file_id"
)
# Access file metadata
if file_info.file:
print(f"File name: {file_info.file.name}")
print(f"File size: {file_info.file.size}")
print(f"Status: {file_info.file.status}")
# Access download URL
if file_info.downloadInfo:
print(f"Download URL: {file_info.download_info.url}")
# Access preview information
if file_info.previewInfo:
print(f"Preview URL: {file_info.preview_info.preview_url}")
Note
The response includes three optional components: - file: File metadata and processing status - downloadInfo: Direct download URL for the file - previewInfo: Preview URL and connector information
Source code in airia/client/store/sync_store.py
get_files(project_id, store_connector_id, correlation_id=None)
Retrieve all files from a store connector in the Airia store.
This method retrieves information about all files in the specified store connector and project, including file metadata, download URLs, and processing status.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_id
|
str
|
The unique identifier of the project (GUID format) |
required |
store_connector_id
|
str
|
The unique identifier of the store connector (GUID format) |
required |
correlation_id
|
Optional[str]
|
Optional correlation ID for request tracing |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
GetFilesResponse |
GetFilesResponse
|
List of files with metadata, download info, and total count |
Raises:
| Type | Description |
|---|---|
AiriaAPIError
|
If the API request fails, including cases where: - The project_id doesn't exist (404) - The store_connector_id doesn't exist (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 all files from a store connector
files_response = client.store.get_files(
project_id="your_project_id",
store_connector_id="your_store_connector_id"
)
# Access files list
if files_response.files:
for file in files_response.files:
print(f"File: {file.name}, Status: {file.status}, Size: {file.size}")
# Access download URLs
if files_response.downloadInfos:
for download_info in files_response.downloadInfos:
print(f"File ID: {download_info.fileId}, URL: {download_info.url}")
# Access total count
print(f"Total files: {files_response.totalCount}")
Note
The response includes: - files: List of file metadata and processing status - downloadInfos: List of direct download URLs for files - totalCount: Total number of files in the store connector
Source code in airia/client/store/sync_store.py
update_file(store_connector_id, store_file_id, project_id, file_path, pending_ingestion=True, correlation_id=None)
Update an existing file in the Airia store.
This method updates an existing file in the specified store connector and project, with optional ingestion settings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
store_connector_id
|
str
|
The unique identifier of the store connector (GUID format) |
required |
store_file_id
|
str
|
The unique identifier of the file to update (GUID format) |
required |
project_id
|
str
|
The unique identifier of the project (GUID format) |
required |
file_path
|
str
|
Path to the file on disk |
required |
pending_ingestion
|
bool
|
Whether the file should be marked as pending ingestion. Default is True. |
True
|
correlation_id
|
Optional[str]
|
Optional correlation ID for request tracing |
None
|
Returns:
| Type | Description |
|---|---|
str
|
The File ID of the updated file. |
Raises:
| Type | Description |
|---|---|
AiriaAPIError
|
If the API request fails, including cases where: - The store_connector_id doesn't exist (404) - The store_file_id doesn't exist (404) - The project_id doesn't exist (404) - Authentication fails (401) - Access is forbidden (403) - Server errors (5xx) |
ValueError
|
If required parameters are missing or invalid |
Example
Source code in airia/client/store/sync_store.py
upload_file(store_connector_id, project_id, file_path, folder_id=None, pending_ingestion=True, correlation_id=None)
Upload a file to the Airia store.
This method uploads a file to the specified store connector and project, with optional folder organization and ingestion settings.
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 |
file_path
|
str
|
Path to the file on disk |
required |
folder_id
|
Optional[str]
|
Optional folder identifier for organizing the file (GUID format) |
None
|
pending_ingestion
|
bool
|
Whether the file should be marked as pending ingestion. Default is True. |
True
|
correlation_id
|
Optional[str]
|
Optional correlation ID for request tracing |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
File |
File
|
object containing details about the uploaded file. |
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 (400) - 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")
# Upload file
uploaded_file = client.store.upload_file(
store_connector_id="your_store_connector_id",
project_id="your_project_id",
file_path="document.pdf"
)
# Upload with folder organization
uploaded_file = client.store.upload_file(
store_connector_id="your_store_connector_id",
project_id="your_project_id",
file_path="document.pdf",
folder_id="your_folder_id",
)