# 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 Tag
#'
#' @description Tag Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field id integer [optional]
#'
#' @field name character [optional]
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
Tag <- R6::R6Class(
'Tag',
public = list(
`id` = NULL,
`name` = NULL,
initialize = function(
`id`=NULL, `name`=NULL, ...
) {
local.optional.var <- list(...)
if (!is.null(`id`)) {
stopifnot(is.numeric(`id`), length(`id`) == 1)
self$`id` <- `id`
}
if (!is.null(`name`)) {
stopifnot(is.character(`name`), length(`name`) == 1)
self$`name` <- `name`
}
},
toJSON = function() {
TagObject <- list()
if (!is.null(self$`id`)) {
TagObject[['id']] <-
self$`id`
}
if (!is.null(self$`name`)) {
TagObject[['name']] <-
self$`name`
}
TagObject
},
fromJSON = function(TagJson) {
TagObject <- jsonlite::fromJSON(TagJson)
if (!is.null(TagObject$`id`)) {
self$`id` <- TagObject$`id`
}
if (!is.null(TagObject$`name`)) {
self$`name` <- TagObject$`name`
}
self
},
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`id`)) {
sprintf(
'"id":
%d
',
self$`id`
)},
if (!is.null(self$`name`)) {
sprintf(
'"name":
"%s"
',
self$`name`
)}
)
jsoncontent <- paste(jsoncontent, collapse = ",")
paste('{', jsoncontent, '}', sep = "")
},
fromJSONString = function(TagJson) {
TagObject <- jsonlite::fromJSON(TagJson)
self$`id` <- TagObject$`id`
self$`name` <- TagObject$`name`
self
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.