# OpenSilex API
#
# No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
#
# OpenAPI spec version: 1.0.0-rc+2
#
# Generated by: https://github.com/swagger-api/swagger-codegen.git
#' ErrorDTO Class
#'
#' @field title
#' @field message
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
ErrorDTO <- R6::R6Class(
'ErrorDTO',
public = list(
`title` = NULL,
`message` = NULL,
initialize = function(`title`, `message`){
if (!missing(`title`)) {
stopifnot(is.character(`title`), length(`title`) == 1)
self$`title` <- `title`
}
if (!missing(`message`)) {
stopifnot(is.character(`message`), length(`message`) == 1)
self$`message` <- `message`
}
},
toJSON = function() {
ErrorDTOObject <- list()
if (!is.null(self$`title`)) {
ErrorDTOObject[['title']] <- self$`title`
}
if (!is.null(self$`message`)) {
ErrorDTOObject[['message']] <- self$`message`
}
ErrorDTOObject
},
fromJSON = function(ErrorDTOJson) {
ErrorDTOObject <- jsonlite::fromJSON(ErrorDTOJson)
if (!is.null(ErrorDTOObject$`title`)) {
self$`title` <- ErrorDTOObject$`title`
}
if (!is.null(ErrorDTOObject$`message`)) {
self$`message` <- ErrorDTOObject$`message`
}
},
fromJSONObject = function(ErrorDTOObject) {
if (!is.null(ErrorDTOObject$`title`)) {
self$`title` <- ErrorDTOObject$`title`
}
if (!is.null(ErrorDTOObject$`message`)) {
self$`message` <- ErrorDTOObject$`message`
}
},
toJSONString = function() {
sprintf(
'{
"title": %s,
"message": %s
}',
ifelse(is.null(self$`title`), "null",jsonlite::toJSON(self$`title`,auto_unbox=TRUE, null = "null")),
ifelse(is.null(self$`message`), "null",jsonlite::toJSON(self$`message`,auto_unbox=TRUE, null = "null"))
)
},
fromJSONString = function(ErrorDTOJson) {
ErrorDTOObject <- jsonlite::fromJSON(ErrorDTOJson)
self$`title` <- ErrorDTOObject$`title`
self$`message` <- ErrorDTOObject$`message`
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.