# TileDB Storage Platform API
#
# TileDB Storage Platform REST API
#
# The version of the OpenAPI document: 2.2.19
#
# Generated by: https://openapi-generator.tech
#' @docType class
#' @title UDFImage
#'
#' @description UDFImage Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field id character [optional]
#'
#' @field name character [optional]
#'
#' @field language \link{UDFLanguage} [optional]
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
UDFImage <- R6::R6Class(
'UDFImage',
public = list(
`id` = NULL,
`name` = NULL,
`language` = NULL,
initialize = function(
`id`=NULL, `name`=NULL, `language`=NULL, ...
) {
local.optional.var <- list(...)
if (!is.null(`id`)) {
stopifnot(is.character(`id`), length(`id`) == 1)
self$`id` <- `id`
}
if (!is.null(`name`)) {
stopifnot(is.character(`name`), length(`name`) == 1)
self$`name` <- `name`
}
if (!is.null(`language`)) {
stopifnot(R6::is.R6(`language`))
self$`language` <- `language`
}
},
toJSON = function() {
UDFImageObject <- list()
if (!is.null(self$`id`)) {
UDFImageObject[['id']] <-
self$`id`
}
if (!is.null(self$`name`)) {
UDFImageObject[['name']] <-
self$`name`
}
if (!is.null(self$`language`)) {
UDFImageObject[['language']] <-
self$`language`$toJSON()
}
UDFImageObject
},
fromJSON = function(UDFImageJson) {
UDFImageObject <- jsonlite::fromJSON(UDFImageJson)
if (!is.null(UDFImageObject$`id`)) {
self$`id` <- UDFImageObject$`id`
}
if (!is.null(UDFImageObject$`name`)) {
self$`name` <- UDFImageObject$`name`
}
if (!is.null(UDFImageObject$`language`)) {
# MANUAL EDIT AFTER OPENAPI AUTOGEN
# For enums, OpenAPI autogen (1) generates a constructor which requires being called
# with one arguent; (2) generates callsites (such as here) that calls that constructor
# with zero arguments.
#
#languageObject <- UDFLanguage$new()
#languageObject$fromJSON(jsonlite::toJSON(UDFImageObject$language, auto_unbox = TRUE, digits = NA))
languageObject <- UDFLanguage$new(UDFImageObject$language)
self$`language` <- languageObject
}
self
},
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`id`)) {
sprintf(
'"id":
"%s"
',
self$`id`
)},
if (!is.null(self$`name`)) {
sprintf(
'"name":
"%s"
',
self$`name`
)},
if (!is.null(self$`language`)) {
sprintf(
'"language":
%s
',
jsonlite::toJSON(self$`language`$toJSON(), auto_unbox=TRUE, digits = NA)
)}
)
jsoncontent <- paste(jsoncontent, collapse = ",")
paste('{', jsoncontent, '}', sep = "")
},
fromJSONString = function(UDFImageJson) {
UDFImageObject <- jsonlite::fromJSON(UDFImageJson)
self$`id` <- UDFImageObject$`id`
self$`name` <- UDFImageObject$`name`
self$`language` <- UDFLanguage$new()$fromJSON(jsonlite::toJSON(UDFImageObject$language, auto_unbox = TRUE, digits = NA))
self
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.