R/configuration_ingest.R

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

#' @docType class
#' @title ConfigurationIngest
#'
#' @description ConfigurationIngest Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field namespace  character 
#'
#' @field name  character 
#'
#' @field rootEntityType  character 
#'
#' @field workspaceName  named list( character ) 
#'
#' @field methodRepoMethod  named list( character ) 
#'
#' @field outputs  named list( character ) 
#'
#' @field inputs  named list( character ) 
#'
#' @field prerequisites  named list( character ) 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
ConfigurationIngest <- R6::R6Class(
  'ConfigurationIngest',
  public = list(
    `namespace` = NULL,
    `name` = NULL,
    `rootEntityType` = NULL,
    `workspaceName` = NULL,
    `methodRepoMethod` = NULL,
    `outputs` = NULL,
    `inputs` = NULL,
    `prerequisites` = NULL,
    initialize = function(
        `namespace`, `name`, `rootEntityType`, `workspaceName`, `methodRepoMethod`, `outputs`, `inputs`, `prerequisites`, ...
    ) {
      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(`rootEntityType`)) {
        stopifnot(is.character(`rootEntityType`), length(`rootEntityType`) == 1)
        self$`rootEntityType` <- `rootEntityType`
      }
      if (!missing(`workspaceName`)) {
        stopifnot(is.vector(`workspaceName`), length(`workspaceName`) != 0)
        sapply(`workspaceName`, function(x) stopifnot(is.character(x)))
        self$`workspaceName` <- `workspaceName`
      }
      if (!missing(`methodRepoMethod`)) {
        stopifnot(is.vector(`methodRepoMethod`), length(`methodRepoMethod`) != 0)
        sapply(`methodRepoMethod`, function(x) stopifnot(is.character(x)))
        self$`methodRepoMethod` <- `methodRepoMethod`
      }
      if (!missing(`outputs`)) {
        stopifnot(is.vector(`outputs`), length(`outputs`) != 0)
        sapply(`outputs`, function(x) stopifnot(is.character(x)))
        self$`outputs` <- `outputs`
      }
      if (!missing(`inputs`)) {
        stopifnot(is.vector(`inputs`), length(`inputs`) != 0)
        sapply(`inputs`, function(x) stopifnot(is.character(x)))
        self$`inputs` <- `inputs`
      }
      if (!missing(`prerequisites`)) {
        stopifnot(is.vector(`prerequisites`), length(`prerequisites`) != 0)
        sapply(`prerequisites`, function(x) stopifnot(is.character(x)))
        self$`prerequisites` <- `prerequisites`
      }
    },
    toJSON = function() {
      ConfigurationIngestObject <- list()
      if (!is.null(self$`namespace`)) {
        ConfigurationIngestObject[['namespace']] <-
          self$`namespace`
      }
      if (!is.null(self$`name`)) {
        ConfigurationIngestObject[['name']] <-
          self$`name`
      }
      if (!is.null(self$`rootEntityType`)) {
        ConfigurationIngestObject[['rootEntityType']] <-
          self$`rootEntityType`
      }
      if (!is.null(self$`workspaceName`)) {
        ConfigurationIngestObject[['workspaceName']] <-
          self$`workspaceName`
      }
      if (!is.null(self$`methodRepoMethod`)) {
        ConfigurationIngestObject[['methodRepoMethod']] <-
          self$`methodRepoMethod`
      }
      if (!is.null(self$`outputs`)) {
        ConfigurationIngestObject[['outputs']] <-
          self$`outputs`
      }
      if (!is.null(self$`inputs`)) {
        ConfigurationIngestObject[['inputs']] <-
          self$`inputs`
      }
      if (!is.null(self$`prerequisites`)) {
        ConfigurationIngestObject[['prerequisites']] <-
          self$`prerequisites`
      }

      ConfigurationIngestObject
    },
    fromJSON = function(ConfigurationIngestJson) {
      ConfigurationIngestObject <- jsonlite::fromJSON(ConfigurationIngestJson)
      if (!is.null(ConfigurationIngestObject$`namespace`)) {
        self$`namespace` <- ConfigurationIngestObject$`namespace`
      }
      if (!is.null(ConfigurationIngestObject$`name`)) {
        self$`name` <- ConfigurationIngestObject$`name`
      }
      if (!is.null(ConfigurationIngestObject$`rootEntityType`)) {
        self$`rootEntityType` <- ConfigurationIngestObject$`rootEntityType`
      }
      if (!is.null(ConfigurationIngestObject$`workspaceName`)) {
        self$`workspaceName` <- ApiClient$new()$deserializeObj(ConfigurationIngestObject$`workspaceName`, "map(character)", loadNamespace("openapi"))
      }
      if (!is.null(ConfigurationIngestObject$`methodRepoMethod`)) {
        self$`methodRepoMethod` <- ApiClient$new()$deserializeObj(ConfigurationIngestObject$`methodRepoMethod`, "map(character)", loadNamespace("openapi"))
      }
      if (!is.null(ConfigurationIngestObject$`outputs`)) {
        self$`outputs` <- ApiClient$new()$deserializeObj(ConfigurationIngestObject$`outputs`, "map(character)", loadNamespace("openapi"))
      }
      if (!is.null(ConfigurationIngestObject$`inputs`)) {
        self$`inputs` <- ApiClient$new()$deserializeObj(ConfigurationIngestObject$`inputs`, "map(character)", loadNamespace("openapi"))
      }
      if (!is.null(ConfigurationIngestObject$`prerequisites`)) {
        self$`prerequisites` <- ApiClient$new()$deserializeObj(ConfigurationIngestObject$`prerequisites`, "map(character)", loadNamespace("openapi"))
      }
      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$`rootEntityType`)) {
        sprintf(
        '"rootEntityType":
          "%s"
                ',
        self$`rootEntityType`
        )},
        if (!is.null(self$`workspaceName`)) {
        sprintf(
        '"workspaceName":
          "%s"
        ',
        jsonlite::toJSON(lapply(self$`workspaceName`, function(x){ x }), auto_unbox = TRUE, digits=NA)
        )},
        if (!is.null(self$`methodRepoMethod`)) {
        sprintf(
        '"methodRepoMethod":
          "%s"
        ',
        jsonlite::toJSON(lapply(self$`methodRepoMethod`, function(x){ x }), auto_unbox = TRUE, digits=NA)
        )},
        if (!is.null(self$`outputs`)) {
        sprintf(
        '"outputs":
          "%s"
        ',
        jsonlite::toJSON(lapply(self$`outputs`, function(x){ x }), auto_unbox = TRUE, digits=NA)
        )},
        if (!is.null(self$`inputs`)) {
        sprintf(
        '"inputs":
          "%s"
        ',
        jsonlite::toJSON(lapply(self$`inputs`, function(x){ x }), auto_unbox = TRUE, digits=NA)
        )},
        if (!is.null(self$`prerequisites`)) {
        sprintf(
        '"prerequisites":
          "%s"
        ',
        jsonlite::toJSON(lapply(self$`prerequisites`, function(x){ x }), auto_unbox = TRUE, digits=NA)
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(ConfigurationIngestJson) {
      ConfigurationIngestObject <- jsonlite::fromJSON(ConfigurationIngestJson)
      self$`namespace` <- ConfigurationIngestObject$`namespace`
      self$`name` <- ConfigurationIngestObject$`name`
      self$`rootEntityType` <- ConfigurationIngestObject$`rootEntityType`
      self$`workspaceName` <- ApiClient$new()$deserializeObj(ConfigurationIngestObject$`workspaceName`, "map(character)", loadNamespace("openapi"))
      self$`methodRepoMethod` <- ApiClient$new()$deserializeObj(ConfigurationIngestObject$`methodRepoMethod`, "map(character)", loadNamespace("openapi"))
      self$`outputs` <- ApiClient$new()$deserializeObj(ConfigurationIngestObject$`outputs`, "map(character)", loadNamespace("openapi"))
      self$`inputs` <- ApiClient$new()$deserializeObj(ConfigurationIngestObject$`inputs`, "map(character)", loadNamespace("openapi"))
      self$`prerequisites` <- ApiClient$new()$deserializeObj(ConfigurationIngestObject$`prerequisites`, "map(character)", loadNamespace("openapi"))
      self
    }
  )
)
vjcitn/terraClientR documentation built on Dec. 23, 2021, 4:07 p.m.