flip_api.file_services.delete_file ================================== .. py:module:: flip_api.file_services.delete_file Attributes ---------- .. autoapisummary:: flip_api.file_services.delete_file.router Functions --------- .. autoapisummary:: flip_api.file_services.delete_file.delete_model_file Module Contents --------------- .. py:data:: router .. py:function:: 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. :param model_id: ID of the model :type model_id: UUID :param file_name: Name of the file to delete :type file_name: str :param db: Database session :type db: Session :param user_id: ID of the user (obtained from auth token) :type user_id: UUID :returns: Success message if the file was deleted successfully :rtype: 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.