#' Get USGS Parameter Code Information
#'
#' @description `r get_description("parameter-codes")`
#'
#' @export
#' @param parameter_code `r get_ogc_params("parameter-codes")$id`
#' @param parameter_name `r get_ogc_params("parameter-codes")$parameter_name`
#' @param unit_of_measure `r get_ogc_params("parameter-codes")$unit_of_measure`
#' @param parameter_group_code `r get_ogc_params("parameter-codes")$parameter_group_code`
#' @param parameter_description `r get_ogc_params("parameter-codes")$parameter_description`
#' @param medium `r get_ogc_params("parameter-codes")$medium`
#' @param statistical_basis `r get_ogc_params("parameter-codes")$statistical_basis`
#' @param weight_basis `r get_ogc_params("parameter-codes")$weight_basis`
#' @param sample_fraction `r get_ogc_params("parameter-codes")$sample_fraction`
#' @param temperature_basis `r get_ogc_params("parameter-codes")$temperature_basis`
#' @param epa_equivalence `r get_ogc_params("parameter-codes")$epa_equivalence`
#' @param properties A vector of requested columns to be returned from the query.
#' Available options are:
#' `r dataRetrieval:::get_properties_for_docs("parameter-codes", "parameter_code_id")`.
#' The default (`NA`) will return all columns of the data.
#' @param \dots Not used. Included to help differentiate official Water Data API arguments
#' from more seldom used, optional dataRetrieval-specific arguments.
#' @param limit The optional limit parameter is used to control the subset of the
#' selected features that should be returned in each page. The maximum allowable
#' limit is 50000. It may be beneficial to set this number lower if your internet
#' connection is spotty. The default (`NA`) will set the limit to the maximum
#' allowable limit for the service.
#' @param attach_request logical, defaults to `r getOption("dataRetrieval.attach_request")`.
#' If set to `TRUE`, the full request sent to the Water Data API is attached
#' as an attribute to the data set.
#' @examplesIf is_dataRetrieval_user()
#'
#' \donttest{
#' pcode <- "00060"
#' pcode_info <- read_waterdata_parameter_codes(parameter_code = pcode)
#'
#' pcodes <- read_waterdata_parameter_codes(parameter_code = c("00660", "00060"))
#'
#' # equivalent to read_waterdata_metadata("parameter-codes")
#' all_pcodes <- read_waterdata_parameter_codes()
#'
#' total_nutrients <- read_waterdata_parameter_codes(parameter_group_code = "NUT",
#'                                            sample_fraction = "Total")
#'
#' group_of_nutrients <- read_waterdata_parameter_codes(parameter_group_code = "NUT",
#'                                                     unit_of_measure = c("mg/l",
#'                                                     "mg/l as N", "mg/l NO3",
#'                                                     "mg/l asNO2"))
#'
#' }
read_waterdata_parameter_codes <- function(
  parameter_code = NA_character_,
  parameter_name = NA_character_,
  unit_of_measure = NA_character_,
  parameter_group_code = NA_character_,
  parameter_description = NA_character_,
  medium = NA_character_,
  statistical_basis = NA_character_,
  weight_basis = NA_character_,
  sample_fraction = NA_character_,
  temperature_basis = NA_character_,
  epa_equivalence = NA_character_,
  properties = NA_character_,
  ...,
  limit = getOption("dataRetrieval.limit"),
  attach_request = getOption("dataRetrieval.attach_request")
) {
  service <- "parameter-codes"
  output_id <- "parameter_code"
  rlang::check_dots_empty()

  args <- mget(names(formals()))
  args[["convertType"]] <- FALSE
  args[["skipGeometry"]] <- NA
  args[["bbox"]] <- NA
  args[["no_paging"]] <- FALSE # drops id if TRUE
  args[["chunk_size"]] <- NA

  return_list <- get_ogc_data(
    args = args,
    output_id = output_id,
    service = service
  )

  return(return_list)
}
