# OpenAPI Petstore
#
# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
#
# The version of the OpenAPI document: 1.0.0
# Generated by: https://openapi-generator.tech
#' @docType class
#' @title ModelApiResponse
#'
#' @description ModelApiResponse Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field code integer [optional]
#'
#' @field type character [optional]
#'
#' @field message character [optional]
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
ModelApiResponse <- R6::R6Class(
'ModelApiResponse',
public = list(
`code` = NULL,
`type` = NULL,
`message` = NULL,
initialize = function(
`code`=NULL, `type`=NULL, `message`=NULL, ...
) {
local.optional.var <- list(...)
if (!is.null(`code`)) {
stopifnot(is.numeric(`code`), length(`code`) == 1)
self$`code` <- `code`
}
if (!is.null(`type`)) {
stopifnot(is.character(`type`), length(`type`) == 1)
self$`type` <- `type`
}
if (!is.null(`message`)) {
stopifnot(is.character(`message`), length(`message`) == 1)
self$`message` <- `message`
}
},
toJSON = function() {
ModelApiResponseObject <- list()
if (!is.null(self$`code`)) {
ModelApiResponseObject[['code']] <-
self$`code`
}
if (!is.null(self$`type`)) {
ModelApiResponseObject[['type']] <-
self$`type`
}
if (!is.null(self$`message`)) {
ModelApiResponseObject[['message']] <-
self$`message`
}
ModelApiResponseObject
},
fromJSON = function(ModelApiResponseJson) {
ModelApiResponseObject <- jsonlite::fromJSON(ModelApiResponseJson)
if (!is.null(ModelApiResponseObject$`code`)) {
self$`code` <- ModelApiResponseObject$`code`
}
if (!is.null(ModelApiResponseObject$`type`)) {
self$`type` <- ModelApiResponseObject$`type`
}
if (!is.null(ModelApiResponseObject$`message`)) {
self$`message` <- ModelApiResponseObject$`message`
}
self
},
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`code`)) {
sprintf(
'"code":
%d
',
self$`code`
)},
if (!is.null(self$`type`)) {
sprintf(
'"type":
"%s"
',
self$`type`
)},
if (!is.null(self$`message`)) {
sprintf(
'"message":
"%s"
',
self$`message`
)}
)
jsoncontent <- paste(jsoncontent, collapse = ",")
paste('{', jsoncontent, '}', sep = "")
},
fromJSONString = function(ModelApiResponseJson) {
ModelApiResponseObject <- jsonlite::fromJSON(ModelApiResponseJson)
self$`code` <- ModelApiResponseObject$`code`
self$`type` <- ModelApiResponseObject$`type`
self$`message` <- ModelApiResponseObject$`message`
self
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.