# 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 Subscription
#'
#' @description Subscription Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field id character [optional]
#'
#' @field owner_namespace_uuid character [optional]
#'
#' @field customer_namespace_uuid character [optional]
#'
#' @field pricing list( \link{Pricing} ) [optional]
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
Subscription <- R6::R6Class(
'Subscription',
public = list(
`id` = NULL,
`owner_namespace_uuid` = NULL,
`customer_namespace_uuid` = NULL,
`pricing` = NULL,
initialize = function(
`id`=NULL, `owner_namespace_uuid`=NULL, `customer_namespace_uuid`=NULL, `pricing`=NULL, ...
) {
local.optional.var <- list(...)
if (!is.null(`id`)) {
stopifnot(is.character(`id`), length(`id`) == 1)
self$`id` <- `id`
}
if (!is.null(`owner_namespace_uuid`)) {
stopifnot(is.character(`owner_namespace_uuid`), length(`owner_namespace_uuid`) == 1)
self$`owner_namespace_uuid` <- `owner_namespace_uuid`
}
if (!is.null(`customer_namespace_uuid`)) {
stopifnot(is.character(`customer_namespace_uuid`), length(`customer_namespace_uuid`) == 1)
self$`customer_namespace_uuid` <- `customer_namespace_uuid`
}
if (!is.null(`pricing`)) {
stopifnot(is.vector(`pricing`), length(`pricing`) != 0)
sapply(`pricing`, function(x) stopifnot(R6::is.R6(x)))
self$`pricing` <- `pricing`
}
},
toJSON = function() {
SubscriptionObject <- list()
if (!is.null(self$`id`)) {
SubscriptionObject[['id']] <-
self$`id`
}
if (!is.null(self$`owner_namespace_uuid`)) {
SubscriptionObject[['owner_namespace_uuid']] <-
self$`owner_namespace_uuid`
}
if (!is.null(self$`customer_namespace_uuid`)) {
SubscriptionObject[['customer_namespace_uuid']] <-
self$`customer_namespace_uuid`
}
if (!is.null(self$`pricing`)) {
SubscriptionObject[['pricing']] <-
lapply(self$`pricing`, function(x) x$toJSON())
}
SubscriptionObject
},
fromJSON = function(SubscriptionJson) {
SubscriptionObject <- jsonlite::fromJSON(SubscriptionJson)
if (!is.null(SubscriptionObject$`id`)) {
self$`id` <- SubscriptionObject$`id`
}
if (!is.null(SubscriptionObject$`owner_namespace_uuid`)) {
self$`owner_namespace_uuid` <- SubscriptionObject$`owner_namespace_uuid`
}
if (!is.null(SubscriptionObject$`customer_namespace_uuid`)) {
self$`customer_namespace_uuid` <- SubscriptionObject$`customer_namespace_uuid`
}
if (!is.null(SubscriptionObject$`pricing`)) {
self$`pricing` <- ApiClient$new()$deserializeObj(SubscriptionObject$`pricing`, "array[Pricing]", loadNamespace("tiledbcloud"))
}
self
},
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`id`)) {
sprintf(
'"id":
"%s"
',
self$`id`
)},
if (!is.null(self$`owner_namespace_uuid`)) {
sprintf(
'"owner_namespace_uuid":
"%s"
',
self$`owner_namespace_uuid`
)},
if (!is.null(self$`customer_namespace_uuid`)) {
sprintf(
'"customer_namespace_uuid":
"%s"
',
self$`customer_namespace_uuid`
)},
if (!is.null(self$`pricing`)) {
sprintf(
'"pricing":
[%s]
',
paste(sapply(self$`pricing`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox=TRUE, digits = NA)), collapse=",")
)}
)
jsoncontent <- paste(jsoncontent, collapse = ",")
paste('{', jsoncontent, '}', sep = "")
},
fromJSONString = function(SubscriptionJson) {
SubscriptionObject <- jsonlite::fromJSON(SubscriptionJson)
self$`id` <- SubscriptionObject$`id`
self$`owner_namespace_uuid` <- SubscriptionObject$`owner_namespace_uuid`
self$`customer_namespace_uuid` <- SubscriptionObject$`customer_namespace_uuid`
self$`pricing` <- ApiClient$new()$deserializeObj(SubscriptionObject$`pricing`, "array[Pricing]", loadNamespace("tiledbcloud"))
self
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.