diff --git a/DESCRIPTION b/DESCRIPTION index c2dae94..c51ba47 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -12,9 +12,9 @@ RoxygenNote: 7.2.3 Imports: askpass, assertthat, - dplyr, httr2, magrittr, + openssl, purrr Suggests: testthat (>= 3.0.0) diff --git a/NAMESPACE b/NAMESPACE index 890df29..2dc5821 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -3,4 +3,5 @@ export("%>%") export(get_access_token) export(get_fields) +export(get_records) importFrom(magrittr,"%>%") diff --git a/R/get_access_token.R b/R/get_access_token.R index 24c1db0..54b2907 100644 --- a/R/get_access_token.R +++ b/R/get_access_token.R @@ -6,9 +6,9 @@ #' @return Invisibily, an access token upon succes #' @export #' -#' @examples +#' @examples \dontrun{get_access_token("my_username")} get_access_token <- - function(username = "phuybrechts", quiet = FALSE) { + function(username, quiet = FALSE) { # check input params assertthat::assert_that(assertthat::is.string(username)) assertthat::assert_that(assertthat::is.flag(quiet)) diff --git a/R/get_fields.R b/R/get_fields.R index e88c7dd..0adf6e5 100644 --- a/R/get_fields.R +++ b/R/get_fields.R @@ -7,7 +7,7 @@ #' inspection #' @export #' -#' @examples +#' @examples \dontrun{get_fields("Vespa-Watch")} get_fields <- function(name = "Vespa-Watch", access_token = get_access_token(quiet = TRUE)) { # check input params assertthat::assert_that(assertthat::is.string(access_token)) diff --git a/R/get_records.R b/R/get_records.R index 511ab51..f0359eb 100644 --- a/R/get_records.R +++ b/R/get_records.R @@ -3,10 +3,10 @@ #' @param inspection_name name of the custom inspection to return records for #' @param access_token access token from `get_access_token()` #' -#' @return +#' @return a tibble with the records from the selected inspection. #' @export #' -#' @examples +#' @examples \dontrun{get_records("Vespa-Watch")} get_records <- function(inspection_name = "Vespa-Watch", access_token = get_access_token(quiet = TRUE)) { # check input params diff --git a/man/get_access_token.Rd b/man/get_access_token.Rd index 4199e61..a502bbb 100644 --- a/man/get_access_token.Rd +++ b/man/get_access_token.Rd @@ -4,7 +4,7 @@ \alias{get_access_token} \title{Login to iAsset and retreive access token} \usage{ -get_access_token(username = "phuybrechts", quiet = FALSE) +get_access_token(username, quiet = FALSE) } \arguments{ \item{username}{the iAsset username} @@ -17,3 +17,6 @@ Invisibily, an access token upon succes \description{ Login to iAsset and retreive access token } +\examples{ +\dontrun{get_access_token("my_username")} +} diff --git a/man/get_fields.Rd b/man/get_fields.Rd index 1b87f52..075dcb8 100644 --- a/man/get_fields.Rd +++ b/man/get_fields.Rd @@ -2,13 +2,22 @@ % Please edit documentation in R/get_fields.R \name{get_fields} \alias{get_fields} -\title{Title} +\title{Get information about a custom inspection} \usage{ -get_fields(name, access_token = get_access_token()) +get_fields(name = "Vespa-Watch", access_token = get_access_token(quiet = TRUE)) } \arguments{ -\item{access_token}{} +\item{name}{name of the custom inspection to return fields for} + +\item{access_token}{access token from \code{get_access_token()}} +} +\value{ +a list object with the name, id and fields (data.frame) of the custom +inspection } \description{ -Title +Get information about a custom inspection +} +\examples{ +\dontrun{get_fields("Vespa-Watch")} } diff --git a/man/get_records.Rd b/man/get_records.Rd new file mode 100644 index 0000000..0d36cbc --- /dev/null +++ b/man/get_records.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/get_records.R +\name{get_records} +\alias{get_records} +\title{Title} +\usage{ +get_records( + inspection_name = "Vespa-Watch", + access_token = get_access_token(quiet = TRUE) +) +} +\arguments{ +\item{inspection_name}{name of the custom inspection to return records for} + +\item{access_token}{access token from \code{get_access_token()}} +} +\value{ +a tibble with the records from the selected inspection. +} +\description{ +Title +} +\examples{ +\dontrun{get_records("Vespa-Watch")} +}