flip_api.file_services.delete_file

Attributes

router

Functions

delete_model_file(, user_id, str])

Delete a model file from S3 and the database.

Module Contents

flip_api.file_services.delete_file.router
flip_api.file_services.delete_file.delete_model_file(model_id: uuid.UUID, file_name: flip_api.domain.schemas.file.SafeFileName, db: sqlmodel.Session = Depends(get_session), user_id: uuid.UUID = Depends(verify_token)) dict[str, str]

Delete a model file from S3 and the database.

Parameters:
  • model_id (UUID) – ID of the model

  • file_name (str) – Name of the file to delete

  • db (Session) – Database session

  • user_id (UUID) – ID of the user (obtained from auth token)

Returns:

Success message if the file was deleted successfully

Return type:

dict[str, str]

Raises:

HTTPException – If the user is not allowed, if the model file is not found, or if there is an error during deletion.