R/workspace_details.R

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

#' @docType class
#' @title WorkspaceDetails
#'
#' @description WorkspaceDetails Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field attributes  object [optional]
#'
#' @field authorizationDomain  list( \link{ManagedGroupRef} ) [optional]
#'
#' @field bucketName  character 
#'
#' @field createdBy  character 
#'
#' @field createdDate  character 
#'
#' @field isLocked  character 
#'
#' @field lastModified  character 
#'
#' @field name  character 
#'
#' @field namespace  character 
#'
#' @field workflowCollectionName  character [optional]
#'
#' @field workspaceId  character 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
WorkspaceDetails <- R6::R6Class(
  'WorkspaceDetails',
  public = list(
    `attributes` = NULL,
    `authorizationDomain` = NULL,
    `bucketName` = NULL,
    `createdBy` = NULL,
    `createdDate` = NULL,
    `isLocked` = NULL,
    `lastModified` = NULL,
    `name` = NULL,
    `namespace` = NULL,
    `workflowCollectionName` = NULL,
    `workspaceId` = NULL,
    initialize = function(
        `bucketName`, `createdBy`, `createdDate`, `isLocked`, `lastModified`, `name`, `namespace`, `workspaceId`, `attributes`=NULL, `authorizationDomain`=NULL, `workflowCollectionName`=NULL, ...
    ) {
      local.optional.var <- list(...)
      if (!missing(`bucketName`)) {
        stopifnot(is.character(`bucketName`), length(`bucketName`) == 1)
        self$`bucketName` <- `bucketName`
      }
      if (!missing(`createdBy`)) {
        stopifnot(is.character(`createdBy`), length(`createdBy`) == 1)
        self$`createdBy` <- `createdBy`
      }
      if (!missing(`createdDate`)) {
        stopifnot(is.character(`createdDate`), length(`createdDate`) == 1)
        self$`createdDate` <- `createdDate`
      }
      if (!missing(`isLocked`)) {
        self$`isLocked` <- `isLocked`
      }
      if (!missing(`lastModified`)) {
        stopifnot(is.character(`lastModified`), length(`lastModified`) == 1)
        self$`lastModified` <- `lastModified`
      }
      if (!missing(`name`)) {
        stopifnot(is.character(`name`), length(`name`) == 1)
        self$`name` <- `name`
      }
      if (!missing(`namespace`)) {
        stopifnot(is.character(`namespace`), length(`namespace`) == 1)
        self$`namespace` <- `namespace`
      }
      if (!missing(`workspaceId`)) {
        stopifnot(is.character(`workspaceId`), length(`workspaceId`) == 1)
        self$`workspaceId` <- `workspaceId`
      }
      if (!is.null(`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(`workflowCollectionName`)) {
        stopifnot(is.character(`workflowCollectionName`), length(`workflowCollectionName`) == 1)
        self$`workflowCollectionName` <- `workflowCollectionName`
      }
    },
    toJSON = function() {
      WorkspaceDetailsObject <- list()
      if (!is.null(self$`attributes`)) {
        WorkspaceDetailsObject[['attributes']] <-
          self$`attributes`
      }
      if (!is.null(self$`authorizationDomain`)) {
        WorkspaceDetailsObject[['authorizationDomain']] <-
          lapply(self$`authorizationDomain`, function(x) x$toJSON())
      }
      if (!is.null(self$`bucketName`)) {
        WorkspaceDetailsObject[['bucketName']] <-
          self$`bucketName`
      }
      if (!is.null(self$`createdBy`)) {
        WorkspaceDetailsObject[['createdBy']] <-
          self$`createdBy`
      }
      if (!is.null(self$`createdDate`)) {
        WorkspaceDetailsObject[['createdDate']] <-
          self$`createdDate`
      }
      if (!is.null(self$`isLocked`)) {
        WorkspaceDetailsObject[['isLocked']] <-
          self$`isLocked`
      }
      if (!is.null(self$`lastModified`)) {
        WorkspaceDetailsObject[['lastModified']] <-
          self$`lastModified`
      }
      if (!is.null(self$`name`)) {
        WorkspaceDetailsObject[['name']] <-
          self$`name`
      }
      if (!is.null(self$`namespace`)) {
        WorkspaceDetailsObject[['namespace']] <-
          self$`namespace`
      }
      if (!is.null(self$`workflowCollectionName`)) {
        WorkspaceDetailsObject[['workflowCollectionName']] <-
          self$`workflowCollectionName`
      }
      if (!is.null(self$`workspaceId`)) {
        WorkspaceDetailsObject[['workspaceId']] <-
          self$`workspaceId`
      }

      WorkspaceDetailsObject
    },
    fromJSON = function(WorkspaceDetailsJson) {
      WorkspaceDetailsObject <- jsonlite::fromJSON(WorkspaceDetailsJson)
      if (!is.null(WorkspaceDetailsObject$`attributes`)) {
        self$`attributes` <- WorkspaceDetailsObject$`attributes`
      }
      if (!is.null(WorkspaceDetailsObject$`authorizationDomain`)) {
        self$`authorizationDomain` <- ApiClient$new()$deserializeObj(WorkspaceDetailsObject$`authorizationDomain`, "array[ManagedGroupRef]", loadNamespace("openapi"))
      }
      if (!is.null(WorkspaceDetailsObject$`bucketName`)) {
        self$`bucketName` <- WorkspaceDetailsObject$`bucketName`
      }
      if (!is.null(WorkspaceDetailsObject$`createdBy`)) {
        self$`createdBy` <- WorkspaceDetailsObject$`createdBy`
      }
      if (!is.null(WorkspaceDetailsObject$`createdDate`)) {
        self$`createdDate` <- WorkspaceDetailsObject$`createdDate`
      }
      if (!is.null(WorkspaceDetailsObject$`isLocked`)) {
        self$`isLocked` <- WorkspaceDetailsObject$`isLocked`
      }
      if (!is.null(WorkspaceDetailsObject$`lastModified`)) {
        self$`lastModified` <- WorkspaceDetailsObject$`lastModified`
      }
      if (!is.null(WorkspaceDetailsObject$`name`)) {
        self$`name` <- WorkspaceDetailsObject$`name`
      }
      if (!is.null(WorkspaceDetailsObject$`namespace`)) {
        self$`namespace` <- WorkspaceDetailsObject$`namespace`
      }
      if (!is.null(WorkspaceDetailsObject$`workflowCollectionName`)) {
        self$`workflowCollectionName` <- WorkspaceDetailsObject$`workflowCollectionName`
      }
      if (!is.null(WorkspaceDetailsObject$`workspaceId`)) {
        self$`workspaceId` <- WorkspaceDetailsObject$`workspaceId`
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`attributes`)) {
        sprintf(
        '"attributes":
          "%s"
                ',
        self$`attributes`
        )},
        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$`bucketName`)) {
        sprintf(
        '"bucketName":
          "%s"
                ',
        self$`bucketName`
        )},
        if (!is.null(self$`createdBy`)) {
        sprintf(
        '"createdBy":
          "%s"
                ',
        self$`createdBy`
        )},
        if (!is.null(self$`createdDate`)) {
        sprintf(
        '"createdDate":
          "%s"
                ',
        self$`createdDate`
        )},
        if (!is.null(self$`isLocked`)) {
        sprintf(
        '"isLocked":
          "%s"
                ',
        self$`isLocked`
        )},
        if (!is.null(self$`lastModified`)) {
        sprintf(
        '"lastModified":
          "%s"
                ',
        self$`lastModified`
        )},
        if (!is.null(self$`name`)) {
        sprintf(
        '"name":
          "%s"
                ',
        self$`name`
        )},
        if (!is.null(self$`namespace`)) {
        sprintf(
        '"namespace":
          "%s"
                ',
        self$`namespace`
        )},
        if (!is.null(self$`workflowCollectionName`)) {
        sprintf(
        '"workflowCollectionName":
          "%s"
                ',
        self$`workflowCollectionName`
        )},
        if (!is.null(self$`workspaceId`)) {
        sprintf(
        '"workspaceId":
          "%s"
                ',
        self$`workspaceId`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(WorkspaceDetailsJson) {
      WorkspaceDetailsObject <- jsonlite::fromJSON(WorkspaceDetailsJson)
      self$`attributes` <- WorkspaceDetailsObject$`attributes`
      self$`authorizationDomain` <- ApiClient$new()$deserializeObj(WorkspaceDetailsObject$`authorizationDomain`, "array[ManagedGroupRef]", loadNamespace("openapi"))
      self$`bucketName` <- WorkspaceDetailsObject$`bucketName`
      self$`createdBy` <- WorkspaceDetailsObject$`createdBy`
      self$`createdDate` <- WorkspaceDetailsObject$`createdDate`
      self$`isLocked` <- WorkspaceDetailsObject$`isLocked`
      self$`lastModified` <- WorkspaceDetailsObject$`lastModified`
      self$`name` <- WorkspaceDetailsObject$`name`
      self$`namespace` <- WorkspaceDetailsObject$`namespace`
      self$`workflowCollectionName` <- WorkspaceDetailsObject$`workflowCollectionName`
      self$`workspaceId` <- WorkspaceDetailsObject$`workspaceId`
      self
    }
  )
)
vjcitn/terraClientR documentation built on Dec. 23, 2021, 4:07 p.m.