# sunagriAPI
#
# An instance of OpenSILEX WebService
#
# OpenAPI spec version: 3.3.0
#
# Generated by: https://github.com/swagger-api/swagger-codegen.git
#' SpeciesDTO Class
#'
#' @field uri
#' @field label
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
SpeciesDTO <- R6::R6Class(
'SpeciesDTO',
public = list(
`uri` = NULL,
`label` = NULL,
initialize = function(`uri`, `label`){
if (!missing(`uri`)) {
stopifnot(is.character(`uri`), length(`uri`) == 1)
self$`uri` <- `uri`
}
if (!missing(`label`)) {
stopifnot(is.character(`label`), length(`label`) == 1)
self$`label` <- `label`
}
},
toJSON = function() {
SpeciesDTOObject <- list()
if (!is.null(self$`uri`)) {
SpeciesDTOObject[['uri']] <- self$`uri`
}
if (!is.null(self$`label`)) {
SpeciesDTOObject[['label']] <- self$`label`
}
SpeciesDTOObject
},
fromJSON = function(SpeciesDTOJson) {
SpeciesDTOObject <- jsonlite::fromJSON(SpeciesDTOJson)
if (!is.null(SpeciesDTOObject$`uri`)) {
self$`uri` <- SpeciesDTOObject$`uri`
}
if (!is.null(SpeciesDTOObject$`label`)) {
self$`label` <- SpeciesDTOObject$`label`
}
},
fromJSONObject = function(SpeciesDTOObject) {
if (!is.null(SpeciesDTOObject$`uri`)) {
self$`uri` <- SpeciesDTOObject$`uri`
}
if (!is.null(SpeciesDTOObject$`label`)) {
self$`label` <- SpeciesDTOObject$`label`
}
},
toJSONString = function() {
sprintf(
'{
"uri": %s,
"label": %s
}',
jsonlite::toJSON(self$`uri`,auto_unbox=TRUE, null = "null"),
jsonlite::toJSON(self$`label`,auto_unbox=TRUE, null = "null")
)
},
fromJSONString = function(SpeciesDTOJson) {
SpeciesDTOObject <- jsonlite::fromJSON(SpeciesDTOJson)
self$`uri` <- SpeciesDTOObject$`uri`
self$`label` <- SpeciesDTOObject$`label`
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.