Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ Authors@R:
role = c("aut", "cre"),
email = "luca.belmonte@efsa.europa.eu",
comment = c(ORCID = "0000-0002-7977-9170")))
Description: Provides a pool of functions to query 'DistillerSR' through its
APIs. It features authentication and utilities to retrieve data from
'DistillerSR' projects and reports. See
Description: Interface to 'DistillerSR' APIs. See
<https://apidocs.evidencepartners.com/> for more details.
License: EUPL-1.2
URL: https://openefsa.github.io/distilleR/
Expand Down
8 changes: 0 additions & 8 deletions R/buildAuthenticationRequest.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@
#'
#' @importFrom checkmate assert_string assert_int
#' @importFrom httr2 request req_method req_headers req_timeout
#'
#' @examplesIf FALSE
#' distillerInstanceUrl_ <- "https://url.to.distiller.instance"
#' distillerKey_ <- "YOUR_API_KEY"
#'
#' request_ <- .buildAuthenticationRequest(
#' distillerInstanceUrl = distillerInstanceUrl_,
#' distillerKey = distillerKey_)
#'
#' @keywords internal
#' @noRd
Expand Down
9 changes: 0 additions & 9 deletions R/buildServiceRequest.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,6 @@
#'
#' @importFrom checkmate assert_string assert_list assert_int
#' @importFrom httr2 request req_method req_headers req_timeout req_body_json
#'
#' @examplesIf FALSE
#' serviceUrl_ <- "https://url.to.distiller.instance/projects"
#'
#' distillerToken_ <- getAuthenticationToken()
#'
#' serviceRequest_ <- .buildServiceRequest(
#' serviceUrl = serviceUrl_,
#' distillerToken = distillerToken_)
#'
#' @keywords internal
#' @noRd
Expand Down
7 changes: 4 additions & 3 deletions R/getAuthenticationToken.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,17 @@
#'
#' @importFrom checkmate assert_string assert_int
#'
#' @examplesIf FALSE
#' @examples
#' \dontrun{
#' # If 'DISTILLER_INSTANCE_URL' and 'DISTILLER_API_KEY' are defined in your
#' # environment (e.g. .Renviron).
#' distillerToken_ <- getAuthenticationToken()
#'
#' # If 'distillerInstanceUrl' and 'distillerKey' are to be specified manually.
#' distillerToken_ <- getAuthenticationToken(
#' distillerInstanceUrl = "https://url.to.distiller.instance",
#' distillerKey = "YOUR_API_KEY"
#' )
#' distillerKey = "YOUR_API_KEY")
#' }
#'
#' @export
#'
Expand Down
4 changes: 3 additions & 1 deletion R/getProjects.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@
#'
#' @seealso \code{\link{getAuthenticationToken}}
#'
#' @examplesIf FALSE
#' @examples
#' \dontrun{
#' distillerToken_ <- getAuthenticationToken()
#'
#' projects_ <- getProjects(distillerToken = distillerToken_)
#' }
#'
#' @export
#'
Expand Down
6 changes: 5 additions & 1 deletion R/getReport.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@
#' @seealso \code{\link{getProjects}}
#' @seealso \code{\link{getReports}}
#'
#' @examplesIf FALSE
#' @examples
#' \dontrun{
#' distillerToken_ <- getAuthenticationToken()
#'
#' projects_ <- getProjects(distillerToken = distillerToken_)
#'
#' reports_ <- getReports(
#' projectId = projects_$id[1],
#' distillerToken = distillerToken_)
Expand All @@ -59,6 +62,7 @@
#' reportID = reports_$id[7],
#' format = "csv",
#' distillerToken = distillerToken_)
#' }
#'
#' @export
#'
Expand Down
5 changes: 4 additions & 1 deletion R/getReports.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,16 @@
#' @seealso \code{\link{getAuthenticationToken}}
#' @seealso \code{\link{getProjects}}
#'
#' @examplesIf FALSE
#' @examples
#' \dontrun{
#' distillerToken_ <- getAuthenticationToken()
#'
#' projects_ <- getProjects(distillerToken = distillerToken_)
#'
#' reports_ <- getReports(
#' projectId = projects_$id[1],
#' distillerToken = distillerToken_)
#' }
#'
#' @export
#'
Expand Down
5 changes: 0 additions & 5 deletions R/handleHTTPErrors.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
#' @importFrom checkmate assert_class assert_string
#' @importFrom httr2 resp_status
#' @importFrom cli cli_abort
#'
#' @examplesIf FALSE
#' response_ <- req_perform(request("https://example.org/"))
#'
#' .handleHTTPErrors(response = response_)
#'
#' @keywords internal
#' @noRd
Expand Down
5 changes: 0 additions & 5 deletions R/parseCSVResponse.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@
#' @importFrom readr read_csv cols
#' @importFrom httr2 resp_body_string
#' @importFrom cli cli_abort
#'
#' @examplesIf FALSE
#' response_ <- req_perform(request("https://example.org/"))
#'
#' csvResponseData_ <- .parseCSVResponse(response = response_)
#'
#' @keywords internal
#' @noRd
Expand Down
5 changes: 0 additions & 5 deletions R/parseJSONResponse.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
#' @importFrom jsonlite fromJSON
#' @importFrom httr2 resp_body_string
#' @importFrom cli cli_abort
#'
#' @examplesIf FALSE
#' response_ <- req_perform(request("https://example.org/"))
#'
#' responseData_ <- .parseJSONResponse(response = response_)
#'
#' @keywords internal
#' @noRd
Expand Down
5 changes: 0 additions & 5 deletions R/parseXLSXResponse.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
#' @importFrom readxl read_excel
#' @importFrom httr2 resp_body_raw
#' @importFrom cli cli_abort
#'
#' @examplesIf FALSE
#' response_ <- req_perform(request("https://example.org/"))
#'
#' xlsxResponseData_ <- .parseXLSXResponse(response = response_)
#'
#' @keywords internal
#' @noRd
Expand Down
5 changes: 0 additions & 5 deletions R/performRequest.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
#' @importFrom httr2 req_perform
#' @importFrom cli cli_abort
#'
#' @examplesIf FALSE
#' request_ <- request("https://example.org/")
#'
#' response_ <- .performRequest(request = request_)
#'
#' @keywords internal
#' @noRd
#'
Expand Down
4 changes: 0 additions & 4 deletions R/sleep.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
#' @param seconds `integer`. The maximum number of seconds to wait.
#'
#' @importFrom checkmate assert_int
#'
#' @examplesIf FALSE
#' # Sleep for 1 second.
#' .sleep(1)
#'
#' @keywords internal
#' @noRd
Expand Down
2 changes: 1 addition & 1 deletion man/distilleR-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/getAuthenticationToken.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions man/getProjects.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions man/getReport.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/getReports.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading