Skip to content

Commit

Permalink
#216 formatter inSDMXDotStatRequestBuilder, Rdoc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Jan 9, 2025
1 parent bbc402f commit e3596d4
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 19 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: rsdmx
Version: 0.6-4
Date: 2024-12-16
Version: 0.6-5
Date: 2025-01-09
Title: Tools for Reading SDMX Data and Metadata
Authors@R: c(
person("Emmanuel", "Blondel", role = c("aut", "cre"), email = "emmanuel.blondel1@gmail.com", comment = c(ORCID = "0000-0002-5870-5762")),
Expand Down
21 changes: 12 additions & 9 deletions R/SDMXDotStatRequestBuilder-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
#' @aliases SDMXDotStatRequestBuilder,SDMXDotStatRequestBuilder-method
#'
#' @usage
#' SDMXDotStatRequestBuilder(regUrl, repoUrl, accessKey = NULL,
#' SDMXDotStatRequestBuilder(regUrl, repoUrl, accessKey = NULL, formatter = NULL,
#' unsupportedResources = list(), skipProviderId = FALSE, forceProviderId = FALSE,
#' headers = list())
#'
#' @param regUrl an object of class "character" giving the base Url of the SDMX service registry
#' @param repoUrl an object of class "character" giving the base Url of the SDMX service repository
#' @param accessKey an object of class "character" indicating the name of request parameter for which
#' an authentication or subscription user key (token) has to be provided to perform requests
#' @param formatter an object of class "list" giving a formatting function (for each resource) that
#' takes an object of class "SDMXRequestParams" as single argument. Such parameter allows
#' to customize eventual params (e.g. specific data provider rules)
#' @param unsupportedResources an object of class "list" giving eventual unsupported
#' REST resources. Default is an empty list object
#' @param skipProviderId an object of class "logical" indicating that the provider
Expand All @@ -27,19 +30,19 @@
#' @export
#'
SDMXDotStatRequestBuilder <- function(regUrl, repoUrl, accessKey = NULL,
formatter = NULL,
unsupportedResources = list(),
skipProviderId = FALSE, forceProviderId = FALSE,
headers = list()){

#params formatter
formatter = list(
#dataflow
dataflow = function(obj){return(obj)},
#datastructure
datastructure = function(obj){ return(obj)},
#data
data = function(obj){return(obj)}
)
if(is.null(formatter)) formatter = list()
#dataflow
if(is.null(formatter$dataflow)) formatter$dataflow = function(obj){return(obj)}
#datastructure
if(is.null(formatter$datastructure)) formatter$datastructure = function(obj){ return(obj)}
#data
if(is.null(formatter$data)) formatter$data = function(obj){return(obj)}

#resource handler
handler <- list(
Expand Down
2 changes: 1 addition & 1 deletion R/SDMXREST20RequestBuilder-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' @aliases SDMXREST20RequestBuilder,SDMXREST20RequestBuilder-method
#'
#' @usage
#' SDMXREST20RequestBuilder(regUrl, repoUrl, accessKey = NULL, compliant,
#' SDMXREST20RequestBuilder(regUrl, repoUrl, accessKey = NULL, formatter, compliant,
#' unsupportedResources = list(), skipProviderId = FALSE, forceProviderId = FALSE,
#' headers = list())
#'
Expand Down
2 changes: 1 addition & 1 deletion R/SDMXREST21RequestBuilder-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' @aliases SDMXREST21RequestBuilder,SDMXREST21RequestBuilder-method
#'
#' @usage
#' SDMXREST21RequestBuilder(regUrl, repoUrl, accessKey = NULL, compliant,
#' SDMXREST21RequestBuilder(regUrl, repoUrl, accessKey = NULL, formatter = NULL, compliant,
#' unsupportedResources = list(), skipProviderId = FALSE, forceProviderId = FALSE,
#' headers = list())
#'
Expand Down
3 changes: 2 additions & 1 deletion R/SDMXRequestParams-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
#' params <- SDMXRequestParams(
#' regUrl = "", repoUrl ="", accessKey = NULL,
#' providerId = "", agencyId ="", resource = "data", resourceId = "",
#' version = "", flowRef = "", key = NULL, start = NULL, end = NULL, references = NULL, compliant = FALSE
#' version = "", flowRef = "", key = NULL, start = NULL, end = NULL,
#' references = NULL, compliant = FALSE
#' )
#' @export
#'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Build Status](https://github.com/opensdmx/rsdmx/actions/workflows/r-cmd-check.yml/badge.svg?branch=master)](https://github.com/opensdmx/rsdmx/actions/workflows/r-cmd-check.yml)
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/rsdmx)](https://cran.r-project.org/package=rsdmx)
[![cran checks](https://badges.cranchecks.info/worst/rsdmx.svg)](https://cran.r-project.org/web/checks/check_results_rsdmx.html)
[![Github_Status_Badge](https://img.shields.io/badge/Github-0.6--4-blue.svg)](https://github.com/opensdmx/rsdmx)
[![Github_Status_Badge](https://img.shields.io/badge/Github-0.6--5-blue.svg)](https://github.com/opensdmx/rsdmx)
[![DOI](https://zenodo.org/badge/5183/opensdmx/rsdmx.svg)](https://doi.org/10.5281/zenodo.592404)

``rsdmx``: Tools for reading SDMX data and metadata documents in R
Expand Down
6 changes: 5 additions & 1 deletion man/SDMXDotStatRequestBuilder.Rd

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

2 changes: 1 addition & 1 deletion man/SDMXREST20RequestBuilder.Rd

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

2 changes: 1 addition & 1 deletion man/SDMXREST21RequestBuilder.Rd

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

3 changes: 2 additions & 1 deletion man/SDMXRequestParams.Rd

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

0 comments on commit e3596d4

Please sign in to comment.