R/workspace_acl.R

# FireCloud
#
# FireCloud API 
#
# The version of the OpenAPI document: 0.1
# 
# Generated by: https://openapi-generator.tech

#' @docType class
#' @title WorkspaceACL
#'
#' @description WorkspaceACL Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field acl  named list( \link{WorkspaceAccessEntry} ) 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
WorkspaceACL <- R6::R6Class(
  'WorkspaceACL',
  public = list(
    `acl` = NULL,
    initialize = function(
        `acl`, ...
    ) {
      local.optional.var <- list(...)
      if (!missing(`acl`)) {
        stopifnot(is.vector(`acl`), length(`acl`) != 0)
        sapply(`acl`, function(x) stopifnot(R6::is.R6(x)))
        self$`acl` <- `acl`
      }
    },
    toJSON = function() {
      WorkspaceACLObject <- list()
      if (!is.null(self$`acl`)) {
        WorkspaceACLObject[['acl']] <-
          lapply(self$`acl`, function(x) x$toJSON())
      }

      WorkspaceACLObject
    },
    fromJSON = function(WorkspaceACLJson) {
      WorkspaceACLObject <- jsonlite::fromJSON(WorkspaceACLJson)
      if (!is.null(WorkspaceACLObject$`acl`)) {
        self$`acl` <- ApiClient$new()$deserializeObj(WorkspaceACLObject$`acl`, "map(WorkspaceAccessEntry)", loadNamespace("openapi"))
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`acl`)) {
        sprintf(
        '"acl":
        %s
',
        jsonlite::toJSON(lapply(self$`acl`, function(x){ x$toJSON() }), auto_unbox = TRUE, digits=NA)
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(WorkspaceACLJson) {
      WorkspaceACLObject <- jsonlite::fromJSON(WorkspaceACLJson)
      self$`acl` <- ApiClient$new()$deserializeObj(WorkspaceACLObject$`acl`, "map(WorkspaceAccessEntry)", loadNamespace("openapi"))
      self
    }
  )
)
vjcitn/terraClientR documentation built on Dec. 23, 2021, 4:07 p.m.