R/workspace_catalog.R

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

#' @docType class
#' @title WorkspaceCatalog
#'
#' @description WorkspaceCatalog Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field email  character 
#'
#' @field catalog  character 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
WorkspaceCatalog <- R6::R6Class(
  'WorkspaceCatalog',
  public = list(
    `email` = NULL,
    `catalog` = NULL,
    initialize = function(
        `email`, `catalog`, ...
    ) {
      local.optional.var <- list(...)
      if (!missing(`email`)) {
        stopifnot(is.character(`email`), length(`email`) == 1)
        self$`email` <- `email`
      }
      if (!missing(`catalog`)) {
        self$`catalog` <- `catalog`
      }
    },
    toJSON = function() {
      WorkspaceCatalogObject <- list()
      if (!is.null(self$`email`)) {
        WorkspaceCatalogObject[['email']] <-
          self$`email`
      }
      if (!is.null(self$`catalog`)) {
        WorkspaceCatalogObject[['catalog']] <-
          self$`catalog`
      }

      WorkspaceCatalogObject
    },
    fromJSON = function(WorkspaceCatalogJson) {
      WorkspaceCatalogObject <- jsonlite::fromJSON(WorkspaceCatalogJson)
      if (!is.null(WorkspaceCatalogObject$`email`)) {
        self$`email` <- WorkspaceCatalogObject$`email`
      }
      if (!is.null(WorkspaceCatalogObject$`catalog`)) {
        self$`catalog` <- WorkspaceCatalogObject$`catalog`
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`email`)) {
        sprintf(
        '"email":
          "%s"
                ',
        self$`email`
        )},
        if (!is.null(self$`catalog`)) {
        sprintf(
        '"catalog":
          "%s"
                ',
        self$`catalog`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(WorkspaceCatalogJson) {
      WorkspaceCatalogObject <- jsonlite::fromJSON(WorkspaceCatalogJson)
      self$`email` <- WorkspaceCatalogObject$`email`
      self$`catalog` <- WorkspaceCatalogObject$`catalog`
      self
    }
  )
)
vjcitn/terraClientR documentation built on Dec. 23, 2021, 4:07 p.m.