def METHOD_NAME(key: str, user_id: int) -> None:
    """Delete secret."""
    secret_model = SecretModel.query.filter(SecretModel.key == key).first()
    if secret_model:
        db.session.delete(secret_model)
        try:
            db.session.commit()
        except Exception as e:
            raise ApiError(
                error_code="delete_secret_error",
                message=f"Could not delete secret with key: {key}. Original error is: {e}",
            ) from e
    else:
        raise ApiError(
            error_code="delete_secret_error",
            message=f"Cannot delete secret with key: {key}. Resource does not exist.",
            status_code=404,
        )