Commit 36073ae0 authored by Dorchies David's avatar Dorchies David
Browse files

docs: own page documentation for get_available_params

parent bd7ab768
No related merge requests found
Showing with 53 additions and 11 deletions
+53 -11
......@@ -22,7 +22,7 @@
#' cfg <- config::get(file = system.file("config.yml", package = "hubeau"))
#' names(cfg$apis)
#'
#' # To get the available operation in an API
#' # To get the available endpoints in an API
#' names(cfg$apis[["prelevements"]]$operations)
#'
#' # To get available parameters in operation "chroniques" of the API "prelevements"
......
#' @rdname doApiQuery
#' List available query parameters of an API endpoint
#'
#' @inheritParams doApiQuery
#'
#' @return A [character] vector with available query parameters for the requested API/endpoint
#'
#' @export
#' @inherit doApiQuery examples
#'
get_available_params <- function(api,
operation,
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/doApiQuery.R, R/get_available_params.R
% Please edit documentation in R/doApiQuery.R
\name{doApiQuery}
\alias{doApiQuery}
\alias{get_available_params}
\title{Main internal functions for querying the Hub'eau APIs}
\usage{
doApiQuery(
......@@ -11,12 +10,6 @@ doApiQuery(
params,
cfg = config::get(file = system.file("config.yml", package = "hubeau"))
)
get_available_params(
api,
operation,
cfg = config::get(file = system.file("config.yml", package = "hubeau"))
)
}
\arguments{
\item{api}{a \link{character} name of the API (e.g.: "indicateurs_services", "prelevements"...), see example for available APIs}
......@@ -45,7 +38,7 @@ The functions \verb{get_[api]_[operation]} call the function \code{doQueryApi} a
cfg <- config::get(file = system.file("config.yml", package = "hubeau"))
names(cfg$apis)
# To get the available operation in an API
# To get the available endpoints in an API
names(cfg$apis[["prelevements"]]$operations)
# To get available parameters in operation "chroniques" of the API "prelevements"
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/get_available_params.R
\name{get_available_params}
\alias{get_available_params}
\title{List available query parameters of an API endpoint}
\usage{
get_available_params(
api,
operation,
cfg = config::get(file = system.file("config.yml", package = "hubeau"))
)
}
\arguments{
\item{api}{a \link{character} name of the API (e.g.: "indicateurs_services", "prelevements"...), see example for available APIs}
\item{operation}{a \link{character} name of the endpoint, see example for available endpoints in an API}
\item{cfg}{a \link{config} object describing the configuration of the APIs. Use the internal package configuration by default
configuration}
}
\value{
A \link{character} vector with available query parameters for the requested API/endpoint
}
\description{
List available query parameters of an API endpoint
}
\examples{
# To get the available APIs in the package
cfg <- config::get(file = system.file("config.yml", package = "hubeau"))
names(cfg$apis)
# To get the available endpoints in an API
names(cfg$apis[["prelevements"]]$operations)
# To get available parameters in operation "chroniques" of the API "prelevements"
get_available_params(api = "prelevements", operation = "chroniques")
# To query the operation "chroniques" of the API "prelevements"
# on all devices in the commune of Romilly-sur-Seine in 2018
doApiQuery(api = "prelevements",
operation = "chroniques",
params = list(code_commune_insee = "10323", annee = "2018"))
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment