flip_api.file_services.uploaded_file
Attributes
Functions
|
Process a scanned file message from SNS. |
Module Contents
- flip_api.file_services.uploaded_file.router
- flip_api.file_services.uploaded_file.process_scanned_file(model_id: uuid.UUID, file: str, db: sqlmodel.Session = Depends(get_session), user_id: uuid.UUID = Depends(verify_token)) dict[str, str]
Process a scanned file message from SNS.
This endpoint receives SNS notifications about scanned files, updates the database, and manages the files in S3 buckets.
- Parameters:
model_id – The ID of the model the file belongs to, extracted from the file’s key
file – The name of the file, extracted from the file’s key
db – Database session
user_id – ID of the user making the request, obtained from authentication
- Returns:
A message indicating the result of the file processing
- Return type:
dict[str, str]
- Raises:
HTTPException – 403 if the caller is not allowed to modify the model, or 500 if the file cannot be processed.