# FireCloud
#
# FireCloud API
#
# The version of the OpenAPI document: 0.1
#
# Generated by: https://openapi-generator.tech
#' @docType class
#' @title MapValueType
#'
#' @description MapValueType Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field keyType \link{ValueType}
#'
#' @field valueType \link{ValueType}
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
MapValueType <- R6::R6Class(
'MapValueType',
public = list(
`keyType` = NULL,
`valueType` = NULL,
initialize = function(
`keyType`, `valueType`, ...
) {
local.optional.var <- list(...)
if (!missing(`keyType`)) {
stopifnot(R6::is.R6(`keyType`))
self$`keyType` <- `keyType`
}
if (!missing(`valueType`)) {
stopifnot(R6::is.R6(`valueType`))
self$`valueType` <- `valueType`
}
},
toJSON = function() {
MapValueTypeObject <- list()
if (!is.null(self$`keyType`)) {
MapValueTypeObject[['keyType']] <-
self$`keyType`$toJSON()
}
if (!is.null(self$`valueType`)) {
MapValueTypeObject[['valueType']] <-
self$`valueType`$toJSON()
}
MapValueTypeObject
},
fromJSON = function(MapValueTypeJson) {
MapValueTypeObject <- jsonlite::fromJSON(MapValueTypeJson)
if (!is.null(MapValueTypeObject$`keyType`)) {
keyTypeObject <- ValueType$new()
keyTypeObject$fromJSON(jsonlite::toJSON(MapValueTypeObject$keyType, auto_unbox = TRUE, digits = NA))
self$`keyType` <- keyTypeObject
}
if (!is.null(MapValueTypeObject$`valueType`)) {
valueTypeObject <- ValueType$new()
valueTypeObject$fromJSON(jsonlite::toJSON(MapValueTypeObject$valueType, auto_unbox = TRUE, digits = NA))
self$`valueType` <- valueTypeObject
}
self
},
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`keyType`)) {
sprintf(
'"keyType":
%s
',
jsonlite::toJSON(self$`keyType`$toJSON(), auto_unbox=TRUE, digits = NA)
)},
if (!is.null(self$`valueType`)) {
sprintf(
'"valueType":
%s
',
jsonlite::toJSON(self$`valueType`$toJSON(), auto_unbox=TRUE, digits = NA)
)}
)
jsoncontent <- paste(jsoncontent, collapse = ",")
paste('{', jsoncontent, '}', sep = "")
},
fromJSONString = function(MapValueTypeJson) {
MapValueTypeObject <- jsonlite::fromJSON(MapValueTypeJson)
self$`keyType` <- ValueType$new()$fromJSON(jsonlite::toJSON(MapValueTypeObject$keyType, auto_unbox = TRUE, digits = NA))
self$`valueType` <- ValueType$new()$fromJSON(jsonlite::toJSON(MapValueTypeObject$valueType, auto_unbox = TRUE, digits = NA))
self
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.