# WARNING - Generated by {fusen} from dev/flat_kwb_simulate_inflow.Rmd: do not edit by hand # nolint: line_length_linter.

#' get_stop_text
#' 
#' This function does the same thing as kwb.utils::get_stop_text(),
#' but it is bundled with *ambre* to avoid a hard dependency on the
#' unmaintained package.
#' 
#' Description
#' @param keyword character text to evaluate
#' @references
#'   Sonnenberg H (2024). kwb.utils: General Utility Functions Developed at KWB. R package version 0.15.0
#'   URL: \url{https://github.com/kwb-r/kwb.utils}
#'   (MIT Licence)
#' @return text
#' 
#' @noRd
#' @examples
#' get_stop_text("must_be_value")
get_stop_text <- function(keyword = NULL)
{
  texts <- list(
    doseresponse_config_incomplete = paste0(
      "Doseresponse configuration incomplete for pathogen %s.\n",
      "Define required parameter(s), either k (for exponential model) or\n",
      "alpha & N50 (for beta-poisson model)"
    ),
    must_be_value = paste0(
      "%s in configuration 'exposure' MUST be of 'type' ", 
      "= 'value' and column 'value' has to be numeric"
    ),
    no_such_distribution = paste0(
      "Your value for parameter 'type' = %s is not an implemented distribution.\n",
      "Valid values of 'type' are:\n",
      "'uniform', 'triangle', 'norm', 'lognorm', 'log10_uniform' or 'log10_norm'"
    )
  )
  
  if (is.null(keyword)) {
    return(texts)
  }
  
  if (! keyword %in% names(texts)) {
    stop(
      "No such keyword: ", keyword, ". Available keywords:\n",
      paste(names(texts), collapse = ", "), call. = FALSE
    )
  }
  
  texts[[keyword]]
}
