R/file_property_name.R

Defines functions .parse_FilePropertyName

# 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 FilePropertyName
#'
#' @description FilePropertyName Class
#'
#' @format An \code{R6Class} generator object
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
FilePropertyName <- R6::R6Class(
    "FilePropertyName",
    public = list(
        initialize = function(...) {
            local.optional.var <- list(...)
            val <- unlist(local.optional.var)

            # MANUAL EDIT AFTER OPENAPI AUTOGEN
            .check_openapi_enum("FilePropertyName", val, .parse_FilePropertyName())

            private$value <- val
        },
        toJSON = function() {
            jsonlite::toJSON(private$value, auto_unbox = TRUE)
        },
        fromJSON = function(FilePropertyNameJson) {
            private$value <- jsonlite::fromJSON(FilePropertyNameJson,
                simplifyVector = FALSE)
            self
        },
        toJSONString = function() {
            as.character(jsonlite::toJSON(private$value,
                auto_unbox = TRUE))
        },
        fromJSONString = function(FilePropertyNameJson) {
            private$value <- jsonlite::fromJSON(FilePropertyNameJson,
                simplifyVector = FALSE)
            self
        }
    ),
    private = list(
        value = NULL
    )
)

# add to utils.R
.parse_FilePropertyName <- function(vals) {
    res <- gsub("^\\[|\\]$", "",
        "[image, size, code_block, udf_language, is_dashboard]"
    )
    unlist(strsplit(res, ", "))
}
TileDB-Inc/TileDB-Cloud-R documentation built on July 18, 2024, 3:33 p.m.