# FireCloud
#
# FireCloud API
#
# The version of the OpenAPI document: 0.1
#
# Generated by: https://openapi-generator.tech
#' @docType class
#' @title WorkspaceRequest
#'
#' @description WorkspaceRequest Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field namespace character
#'
#' @field name character
#'
#' @field authorizationDomain list( \link{ManagedGroupRef} ) [optional]
#'
#' @field attributes object
#'
#' @field noWorkspaceOwner character [optional]
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
WorkspaceRequest <- R6::R6Class(
'WorkspaceRequest',
public = list(
`namespace` = NULL,
`name` = NULL,
`authorizationDomain` = NULL,
`attributes` = NULL,
`noWorkspaceOwner` = NULL,
initialize = function(
`namespace`, `name`, `attributes`, `authorizationDomain`=NULL, `noWorkspaceOwner`=FALSE, ...
) {
local.optional.var <- list(...)
if (!missing(`namespace`)) {
stopifnot(is.character(`namespace`), length(`namespace`) == 1)
self$`namespace` <- `namespace`
}
if (!missing(`name`)) {
stopifnot(is.character(`name`), length(`name`) == 1)
self$`name` <- `name`
}
if (!missing(`attributes`)) {
self$`attributes` <- `attributes`
}
if (!is.null(`authorizationDomain`)) {
stopifnot(is.vector(`authorizationDomain`), length(`authorizationDomain`) != 0)
sapply(`authorizationDomain`, function(x) stopifnot(R6::is.R6(x)))
self$`authorizationDomain` <- `authorizationDomain`
}
if (!is.null(`noWorkspaceOwner`)) {
self$`noWorkspaceOwner` <- `noWorkspaceOwner`
}
},
toJSON = function() {
WorkspaceRequestObject <- list()
if (!is.null(self$`namespace`)) {
WorkspaceRequestObject[['namespace']] <-
self$`namespace`
}
if (!is.null(self$`name`)) {
WorkspaceRequestObject[['name']] <-
self$`name`
}
if (!is.null(self$`authorizationDomain`)) {
WorkspaceRequestObject[['authorizationDomain']] <-
lapply(self$`authorizationDomain`, function(x) x$toJSON())
}
if (!is.null(self$`attributes`)) {
WorkspaceRequestObject[['attributes']] <-
self$`attributes`
}
if (!is.null(self$`noWorkspaceOwner`)) {
WorkspaceRequestObject[['noWorkspaceOwner']] <-
self$`noWorkspaceOwner`
}
WorkspaceRequestObject
},
fromJSON = function(WorkspaceRequestJson) {
WorkspaceRequestObject <- jsonlite::fromJSON(WorkspaceRequestJson)
if (!is.null(WorkspaceRequestObject$`namespace`)) {
self$`namespace` <- WorkspaceRequestObject$`namespace`
}
if (!is.null(WorkspaceRequestObject$`name`)) {
self$`name` <- WorkspaceRequestObject$`name`
}
if (!is.null(WorkspaceRequestObject$`authorizationDomain`)) {
self$`authorizationDomain` <- ApiClient$new()$deserializeObj(WorkspaceRequestObject$`authorizationDomain`, "array[ManagedGroupRef]", loadNamespace("openapi"))
}
if (!is.null(WorkspaceRequestObject$`attributes`)) {
self$`attributes` <- WorkspaceRequestObject$`attributes`
}
if (!is.null(WorkspaceRequestObject$`noWorkspaceOwner`)) {
self$`noWorkspaceOwner` <- WorkspaceRequestObject$`noWorkspaceOwner`
}
self
},
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`namespace`)) {
sprintf(
'"namespace":
"%s"
',
self$`namespace`
)},
if (!is.null(self$`name`)) {
sprintf(
'"name":
"%s"
',
self$`name`
)},
if (!is.null(self$`authorizationDomain`)) {
sprintf(
'"authorizationDomain":
[%s]
',
paste(sapply(self$`authorizationDomain`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox=TRUE, digits = NA)), collapse=",")
)},
if (!is.null(self$`attributes`)) {
sprintf(
'"attributes":
"%s"
',
self$`attributes`
)},
if (!is.null(self$`noWorkspaceOwner`)) {
sprintf(
'"noWorkspaceOwner":
"%s"
',
self$`noWorkspaceOwner`
)}
)
jsoncontent <- paste(jsoncontent, collapse = ",")
paste('{', jsoncontent, '}', sep = "")
},
fromJSONString = function(WorkspaceRequestJson) {
WorkspaceRequestObject <- jsonlite::fromJSON(WorkspaceRequestJson)
self$`namespace` <- WorkspaceRequestObject$`namespace`
self$`name` <- WorkspaceRequestObject$`name`
self$`authorizationDomain` <- ApiClient$new()$deserializeObj(WorkspaceRequestObject$`authorizationDomain`, "array[ManagedGroupRef]", loadNamespace("openapi"))
self$`attributes` <- WorkspaceRequestObject$`attributes`
self$`noWorkspaceOwner` <- WorkspaceRequestObject$`noWorkspaceOwner`
self
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.