R/workspace_catalog_response.R

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

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

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