Commit fded729a authored by Jean-Marie Lepioufle's avatar Jean-Marie Lepioufle
Browse files

swagger generated client api

parent a42bc773
Package: frostr
Type: Package
Version: 0.0.1
Authors@R: c(person("Jean-Marie", "Lepioufle", , "jml@nilu.no", role=c("aut","cre")),
person("NILU",role="cph"))
Authors@R: c(person("Jean-Marie", "Lepioufle", , "jml@nilu.no", role=c("aut","cre")))
Title: frostr
Description: Extracting data from frostAPI.
The Frost API provides free access to MET Norway's archive of historical weather and climate data. These data include quality controlled daily, monthly, and yearly measurements of temperature, precipitation, and wind data. Other information, like metadata about weather stations, is also available through the API.
(generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen).
Depends:
R (>= 3.2.3)
Imports:
ecapi
Remotes: git::git@git.nilu.no:rextapi/ecapi.git
Imports: jsonlite, httr, R6
Suggests:
knitr
License: GPL-3
......
# Generated by roxygen2: do not edit by hand
S3method(print,frostr)
export(frostr)
export(ApiClient)
export(CalcMethod)
export(CfConvention)
export(ClimateNormal)
export(ClimateNormalsAvailable)
export(ClimateNormalsAvailableResponse)
export(ClimateNormalsResponse)
export(ClimatenormalsApi)
export(CodeTable)
export(CodeTableResponse)
export(CodeTableValue)
export(Element)
export(ElementResponse)
export(ElementsApi)
export(FrequenciesApi)
export(IDFValue)
export(Level)
export(Location)
export(LocationResponse)
export(LocationsApi)
export(ObsValue)
export(Observation)
export(ObservationResponse)
export(ObservationTimeSeries)
export(ObservationTimeSeriesResponse)
export(ObservationsApi)
export(ObservationsAtRefTime)
export(OldMetNoConvention)
export(Point)
export(QualityInformation)
export(QualityInformationResponse)
export(RainfallIDF)
export(RainfallIDFResponse)
export(RainfallIDFSource)
export(RainfallIDFSourcesResponse)
export(Record)
export(RecordsApi)
export(RecordsResponse)
export(Response)
export(SensorLevels)
export(Source)
export(SourceResponse)
export(SourcesApi)
export(TextualQualityInformation)
export(TimeOffsets)
export(UserQualityInformation)
importFrom(R6,R6Class)
importFrom(jsonlite,fromJSON)
importFrom(jsonlite,toJSON)
#
#
# No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
#
# OpenAPI spec version: v0 - Testing
#
# Generated by: https://github.com/swagger-api/swagger-codegen.git
#' ApiClient Class
#'
#' Generic API client for Swagger client library builds.
#' Swagger generic API client. This client handles the client-
#' server communication, and is invariant across implementations. Specifics of
#' the methods and models for each application are generated from the Swagger
#' templates.
#'
#' NOTE: This class is auto generated by the swagger code generator program.
#' Ref: https://github.com/swagger-api/swagger-codegen
#' Do not edit the class manually.
#'
#' @export
ApiClient <- R6::R6Class(
'ApiClient',
public = list(
basePath = "https://frost.met.no",
configuration = NULL,
userAgent = NULL,
defaultHeaders = NULL,
initialize = function(basePath, configuration, defaultHeaders){
if (!missing(basePath)) {
self$basePath <- basePath
}
if (!missing(configuration)) {
self$configuration <- configuration
}
if (!missing(defaultHeaders)) {
self$defaultHeaders <- defaultHeaders
}
self$`userAgent` <- 'Swagger-Codegen/1.0.0/r'
},
callApi = function(url, method, queryParams, headerParams, body, ...){
headers <- httr::add_headers(headerParams)
if (method == "GET") {
httr::GET(url, queryParams, headers, ...)
}
else if (method == "POST") {
httr::POST(url, queryParams, headers, body = body, ...)
}
else if (method == "PUT") {
httr::PUT(url, queryParams, headers, body = body, ...)
}
else if (method == "PATCH") {
httr::PATCH(url, queryParams, headers, body = body, ...)
}
else if (method == "HEAD") {
httr::HEAD(url, queryParams, headers, ...)
}
else if (method == "DELETE") {
httr::DELETE(url, queryParams, headers, ...)
}
else {
stop("http method must be `GET`, `HEAD`, `OPTIONS`, `POST`, `PATCH`, `PUT` or `DELETE`.")
}
}
)
)
\ No newline at end of file
#
#
# No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
#
# OpenAPI spec version: v0 - Testing
#
# Generated by: https://github.com/swagger-api/swagger-codegen.git
#' CalcMethod Class
#'
#' @field baseName
#' @field method
#' @field innerMethod
#' @field period
#' @field innerPeriod
#' @field addition
#' @field methodDescription
#' @field innerMethodDescription
#' @field methodUnit
#' @field innerMethodUnit
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
CalcMethod <- R6::R6Class(
'CalcMethod',
public = list(
`baseName` = NULL,
`method` = NULL,
`innerMethod` = NULL,
`period` = NULL,
`innerPeriod` = NULL,
`addition` = NULL,
`methodDescription` = NULL,
`innerMethodDescription` = NULL,
`methodUnit` = NULL,
`innerMethodUnit` = NULL,
initialize = function(`baseName`, `method`, `innerMethod`, `period`, `innerPeriod`, `addition`, `methodDescription`, `innerMethodDescription`, `methodUnit`, `innerMethodUnit`){
if (!missing(`baseName`)) {
stopifnot(is.character(`baseName`), length(`baseName`) == 1)
self$`baseName` <- `baseName`
}
if (!missing(`method`)) {
stopifnot(is.character(`method`), length(`method`) == 1)
self$`method` <- `method`
}
if (!missing(`innerMethod`)) {
stopifnot(is.character(`innerMethod`), length(`innerMethod`) == 1)
self$`innerMethod` <- `innerMethod`
}
if (!missing(`period`)) {
stopifnot(is.character(`period`), length(`period`) == 1)
self$`period` <- `period`
}
if (!missing(`innerPeriod`)) {
stopifnot(is.character(`innerPeriod`), length(`innerPeriod`) == 1)
self$`innerPeriod` <- `innerPeriod`
}
if (!missing(`addition`)) {
stopifnot(is.character(`addition`), length(`addition`) == 1)
self$`addition` <- `addition`
}
if (!missing(`methodDescription`)) {
stopifnot(is.character(`methodDescription`), length(`methodDescription`) == 1)
self$`methodDescription` <- `methodDescription`
}
if (!missing(`innerMethodDescription`)) {
stopifnot(is.character(`innerMethodDescription`), length(`innerMethodDescription`) == 1)
self$`innerMethodDescription` <- `innerMethodDescription`
}
if (!missing(`methodUnit`)) {
stopifnot(is.character(`methodUnit`), length(`methodUnit`) == 1)
self$`methodUnit` <- `methodUnit`
}
if (!missing(`innerMethodUnit`)) {
stopifnot(is.character(`innerMethodUnit`), length(`innerMethodUnit`) == 1)
self$`innerMethodUnit` <- `innerMethodUnit`
}
},
toJSON = function() {
CalcMethodObject <- list()
if (!is.null(self$`baseName`)) {
CalcMethodObject[['baseName']] <- self$`baseName`
}
if (!is.null(self$`method`)) {
CalcMethodObject[['method']] <- self$`method`
}
if (!is.null(self$`innerMethod`)) {
CalcMethodObject[['innerMethod']] <- self$`innerMethod`
}
if (!is.null(self$`period`)) {
CalcMethodObject[['period']] <- self$`period`
}
if (!is.null(self$`innerPeriod`)) {
CalcMethodObject[['innerPeriod']] <- self$`innerPeriod`
}
if (!is.null(self$`addition`)) {
CalcMethodObject[['addition']] <- self$`addition`
}
if (!is.null(self$`methodDescription`)) {
CalcMethodObject[['methodDescription']] <- self$`methodDescription`
}
if (!is.null(self$`innerMethodDescription`)) {
CalcMethodObject[['innerMethodDescription']] <- self$`innerMethodDescription`
}
if (!is.null(self$`methodUnit`)) {
CalcMethodObject[['methodUnit']] <- self$`methodUnit`
}
if (!is.null(self$`innerMethodUnit`)) {
CalcMethodObject[['innerMethodUnit']] <- self$`innerMethodUnit`
}
CalcMethodObject
},
fromJSON = function(CalcMethodJson) {
CalcMethodObject <- jsonlite::fromJSON(CalcMethodJson)
if (!is.null(CalcMethodObject$`baseName`)) {
self$`baseName` <- CalcMethodObject$`baseName`
}
if (!is.null(CalcMethodObject$`method`)) {
self$`method` <- CalcMethodObject$`method`
}
if (!is.null(CalcMethodObject$`innerMethod`)) {
self$`innerMethod` <- CalcMethodObject$`innerMethod`
}
if (!is.null(CalcMethodObject$`period`)) {
self$`period` <- CalcMethodObject$`period`
}
if (!is.null(CalcMethodObject$`innerPeriod`)) {
self$`innerPeriod` <- CalcMethodObject$`innerPeriod`
}
if (!is.null(CalcMethodObject$`addition`)) {
self$`addition` <- CalcMethodObject$`addition`
}
if (!is.null(CalcMethodObject$`methodDescription`)) {
self$`methodDescription` <- CalcMethodObject$`methodDescription`
}
if (!is.null(CalcMethodObject$`innerMethodDescription`)) {
self$`innerMethodDescription` <- CalcMethodObject$`innerMethodDescription`
}
if (!is.null(CalcMethodObject$`methodUnit`)) {
self$`methodUnit` <- CalcMethodObject$`methodUnit`
}
if (!is.null(CalcMethodObject$`innerMethodUnit`)) {
self$`innerMethodUnit` <- CalcMethodObject$`innerMethodUnit`
}
},
toJSONString = function() {
sprintf(
'{
"baseName": %s,
"method": %s,
"innerMethod": %s,
"period": %s,
"innerPeriod": %s,
"addition": %s,
"methodDescription": %s,
"innerMethodDescription": %s,
"methodUnit": %s,
"innerMethodUnit": %s
}',
self$`baseName`,
self$`method`,
self$`innerMethod`,
self$`period`,
self$`innerPeriod`,
self$`addition`,
self$`methodDescription`,
self$`innerMethodDescription`,
self$`methodUnit`,
self$`innerMethodUnit`
)
},
fromJSONString = function(CalcMethodJson) {
CalcMethodObject <- jsonlite::fromJSON(CalcMethodJson)
self$`baseName` <- CalcMethodObject$`baseName`
self$`method` <- CalcMethodObject$`method`
self$`innerMethod` <- CalcMethodObject$`innerMethod`
self$`period` <- CalcMethodObject$`period`
self$`innerPeriod` <- CalcMethodObject$`innerPeriod`
self$`addition` <- CalcMethodObject$`addition`
self$`methodDescription` <- CalcMethodObject$`methodDescription`
self$`innerMethodDescription` <- CalcMethodObject$`innerMethodDescription`
self$`methodUnit` <- CalcMethodObject$`methodUnit`
self$`innerMethodUnit` <- CalcMethodObject$`innerMethodUnit`
}
)
)
#
#
# No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
#
# OpenAPI spec version: v0 - Testing
#
# Generated by: https://github.com/swagger-api/swagger-codegen.git
#' CfConvention Class
#'
#' @field standardName
#' @field cellMethod
#' @field unit
#' @field status
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
CfConvention <- R6::R6Class(
'CfConvention',
public = list(
`standardName` = NULL,
`cellMethod` = NULL,
`unit` = NULL,
`status` = NULL,
initialize = function(`standardName`, `cellMethod`, `unit`, `status`){
if (!missing(`standardName`)) {
stopifnot(is.character(`standardName`), length(`standardName`) == 1)
self$`standardName` <- `standardName`
}
if (!missing(`cellMethod`)) {
stopifnot(is.character(`cellMethod`), length(`cellMethod`) == 1)
self$`cellMethod` <- `cellMethod`
}
if (!missing(`unit`)) {
stopifnot(is.character(`unit`), length(`unit`) == 1)
self$`unit` <- `unit`
}
if (!missing(`status`)) {
stopifnot(is.character(`status`), length(`status`) == 1)
self$`status` <- `status`
}
},
toJSON = function() {
CfConventionObject <- list()
if (!is.null(self$`standardName`)) {
CfConventionObject[['standardName']] <- self$`standardName`
}
if (!is.null(self$`cellMethod`)) {
CfConventionObject[['cellMethod']] <- self$`cellMethod`
}
if (!is.null(self$`unit`)) {
CfConventionObject[['unit']] <- self$`unit`
}
if (!is.null(self$`status`)) {
CfConventionObject[['status']] <- self$`status`
}
CfConventionObject
},
fromJSON = function(CfConventionJson) {
CfConventionObject <- jsonlite::fromJSON(CfConventionJson)
if (!is.null(CfConventionObject$`standardName`)) {
self$`standardName` <- CfConventionObject$`standardName`
}
if (!is.null(CfConventionObject$`cellMethod`)) {
self$`cellMethod` <- CfConventionObject$`cellMethod`
}
if (!is.null(CfConventionObject$`unit`)) {
self$`unit` <- CfConventionObject$`unit`
}
if (!is.null(CfConventionObject$`status`)) {
self$`status` <- CfConventionObject$`status`
}
},
toJSONString = function() {
sprintf(
'{
"standardName": %s,
"cellMethod": %s,
"unit": %s,
"status": %s
}',
self$`standardName`,
self$`cellMethod`,
self$`unit`,
self$`status`
)
},
fromJSONString = function(CfConventionJson) {
CfConventionObject <- jsonlite::fromJSON(CfConventionJson)
self$`standardName` <- CfConventionObject$`standardName`
self$`cellMethod` <- CfConventionObject$`cellMethod`
self$`unit` <- CfConventionObject$`unit`
self$`status` <- CfConventionObject$`status`
}
)
)
#
#
# No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
#
# OpenAPI spec version: v0 - Testing
#
# Generated by: https://github.com/swagger-api/swagger-codegen.git
#' ClimateNormal Class
#'
#' @field sourceId
#' @field elementId
#' @field period
#' @field month
#' @field day
#' @field normal
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
ClimateNormal <- R6::R6Class(
'ClimateNormal',
public = list(
`sourceId` = NULL,
`elementId` = NULL,
`period` = NULL,
`month` = NULL,
`day` = NULL,
`normal` = NULL,
initialize = function(`sourceId`, `elementId`, `period`, `month`, `day`, `normal`){
if (!missing(`sourceId`)) {
stopifnot(is.character(`sourceId`), length(`sourceId`) == 1)
self$`sourceId` <- `sourceId`
}
if (!missing(`elementId`)) {
stopifnot(is.character(`elementId`), length(`elementId`) == 1)
self$`elementId` <- `elementId`
}
if (!missing(`period`)) {
stopifnot(is.character(`period`), length(`period`) == 1)
self$`period` <- `period`
}
if (!missing(`month`)) {
stopifnot(R6::is.R6(`month`))
self$`month` <- `month`
}
if (!missing(`day`)) {
stopifnot(R6::is.R6(`day`))
self$`day` <- `day`
}
if (!missing(`normal`)) {
stopifnot(R6::is.R6(`normal`))
self$`normal` <- `normal`
}
},
toJSON = function() {
ClimateNormalObject <- list()
if (!is.null(self$`sourceId`)) {
ClimateNormalObject[['sourceId']] <- self$`sourceId`
}
if (!is.null(self$`elementId`)) {
ClimateNormalObject[['elementId']] <- self$`elementId`
}
if (!is.null(self$`period`)) {
ClimateNormalObject[['period']] <- self$`period`
}
if (!is.null(self$`month`)) {
ClimateNormalObject[['month']] <- self$`month`$toJSON()
}
if (!is.null(self$`day`)) {
ClimateNormalObject[['day']] <- self$`day`$toJSON()
}
if (!is.null(self$`normal`)) {
ClimateNormalObject[['normal']] <- self$`normal`$toJSON()
}
ClimateNormalObject
},
fromJSON = function(ClimateNormalJson) {
ClimateNormalObject <- jsonlite::fromJSON(ClimateNormalJson)
if (!is.null(ClimateNormalObject$`sourceId`)) {
self$`sourceId` <- ClimateNormalObject$`sourceId`
}
if (!is.null(ClimateNormalObject$`elementId`)) {
self$`elementId` <- ClimateNormalObject$`elementId`
}
if (!is.null(ClimateNormalObject$`period`)) {
self$`period` <- ClimateNormalObject$`period`
}
if (!is.null(ClimateNormalObject$`month`)) {
monthObject <- TODO_OBJECT_MAPPING$new()
monthObject$fromJSON(jsonlite::toJSON(ClimateNormalObject$month, auto_unbox = TRUE))
self$`month` <- monthObject
}
if (!is.null(ClimateNormalObject$`day`)) {
dayObject <- TODO_OBJECT_MAPPING$new()
dayObject$fromJSON(jsonlite::toJSON(ClimateNormalObject$day, auto_unbox = TRUE))
self$`day` <- dayObject
}
if (!is.null(ClimateNormalObject$`normal`)) {
normalObject <- TODO_OBJECT_MAPPING$new()
normalObject$fromJSON(jsonlite::toJSON(ClimateNormalObject$normal, auto_unbox = TRUE))
self$`normal` <- normalObject
}
},
toJSONString = function() {
sprintf(
'{
"sourceId": %s,
"elementId": %s,
"period": %s,
"month": %s,
"day": %s,
"normal": %s
}',
self$`sourceId`,
self$`elementId`,
self$`period`,
self$`month`$toJSON(),
self$`day`$toJSON(),
self$`normal`$toJSON()
)
},
fromJSONString = function(ClimateNormalJson) {
ClimateNormalObject <- jsonlite::fromJSON(ClimateNormalJson)
self$`sourceId` <- ClimateNormalObject$`sourceId`
self$`elementId` <- ClimateNormalObject$`elementId`
self$`period` <- ClimateNormalObject$`period`
TODO_OBJECT_MAPPINGObject -> TODO_OBJECT_MAPPING$new()
self$`month` <- TODO_OBJECT_MAPPINGObject$fromJSON(jsonlite::toJSON(ClimateNormalObject$month, auto_unbox = TRUE))
TODO_OBJECT_MAPPINGObject -> TODO_OBJECT_MAPPING$new()
self$`day` <- TODO_OBJECT_MAPPINGObject$fromJSON(jsonlite::toJSON(ClimateNormalObject$day, auto_unbox = TRUE))
TODO_OBJECT_MAPPINGObject -> TODO_OBJECT_MAPPING$new()
self$`normal` <- TODO_OBJECT_MAPPINGObject$fromJSON(jsonlite::toJSON(ClimateNormalObject$normal, auto_unbox = TRUE))
}
)
)
#
#
# No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
#
# OpenAPI spec version: v0 - Testing
#
# Generated by: https://github.com/swagger-api/swagger-codegen.git
#' ClimateNormalsAvailable Class
#'
#' @field sourceId
#' @field elementId
#' @field period
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
ClimateNormalsAvailable <- R6::R6Class(
'ClimateNormalsAvailable',
public = list(
`sourceId` = NULL,
`elementId` = NULL,
`period` = NULL,
initialize = function(`sourceId`, `elementId`, `period`){
if (!missing(`sourceId`)) {
stopifnot(is.character(`sourceId`), length(`sourceId`) == 1)
self$`sourceId` <- `sourceId`
}
if (!missing(`elementId`)) {
stopifnot(is.character(`elementId`), length(`elementId`) == 1)
self$`elementId` <- `elementId`
}
if (!missing(`period`)) {