get_function.Rd
Get the correct function to create the API call depending on the data item
get_function(data_item)
data_item | character string; data item to be retrieved |
---|
function
get_function("TEMP")#> function (data_item, api_key, from_date = NULL, to_date = NULL, #> settlement_date = NULL, settlement_period = NULL, bm_unit_id = NULL, #> bm_unit_type = NULL, lead_party_name = NULL, ngc_bm_unit_name = NULL, #> from_cleared_date = NULL, to_cleared_date = NULL, is_two_day_window = NULL, #> from_datetime = NULL, to_datetime = NULL, from_settlement_date = NULL, #> to_settlement_date = NULL, period = NULL, fuel_type = NULL, #> balancing_service_volume = NULL, zone_identifier = NULL, #> start_time = NULL, end_time = NULL, trade_name = NULL, trade_type = NULL, #> api_version = "v1", service_type = "csv", ...) #> { #> check_data_item(data_item, "Legacy") #> input_params <- get_build_arguments(as.list(as.environment(-1))) #> base_url <- httr::modify_url("https://api.bmreports.com", #> path = paste0("BMRS/", data_item, "/", api_version)) #> additional_params <- list(...) #> fixed_params <- fix_all_parameters(input_params) #> request <- list() #> request$url <- httr::modify_url(base_url, query = c(fixed_params, #> additional_params)) #> request$service_type <- service_type #> request$data_item <- data_item #> return(request) #> } #> <bytecode: 0x5590e14c62f8> #> <environment: namespace:BMRSr>