R/wizard_step_model.R

#' WizardStepModel
#'
#' @export
#' @format \code{\link{R6Class}} object, super class \code{\link{StepModel}}.
#' @field namespace of type String.
#' @field description of type String.
#' @field appDesignType of type String.
#' @field factors list of class \code{\link{MappingFactor}}.
#' @field filters list of class \code{\link{MappingFilter}}.
#' @field steps list of class \code{\link{Step}}.
#' @field defaultFactors list of class \code{\link{MappingFactor}}.
#' @field defaultFilters list of class \code{\link{MappingFilter}}.
WizardStepModel <- R6::R6Class("WizardStepModel", inherit = StepModel, public = list(namespace = NULL,
    description = NULL, appDesignType = NULL, factors = NULL, filters = NULL, steps = NULL,
    defaultFactors = NULL, defaultFilters = NULL, initialize = function(json = NULL) {
        super$initialize(json = json)
    }, init = function() {
        super$init()
        self$namespace = ""
        self$description = ""
        self$appDesignType = ""
        self$factors = list()
        self$filters = list()
        self$steps = list()
        self$defaultFactors = list()
        self$defaultFilters = list()
    }, initJson = function(json) {
        super$initJson(json)
        self$namespace = json$namespace
        self$description = json$description
        self$appDesignType = json$appDesignType
        self$factors = lapply(json$factors, createObjectFromJson)
        self$filters = lapply(json$filters, createObjectFromJson)
        self$steps = lapply(json$steps, createObjectFromJson)
        self$defaultFactors = lapply(json$defaultFactors, createObjectFromJson)
        self$defaultFilters = lapply(json$defaultFilters, createObjectFromJson)
    }, toTson = function() {
        m = super$toTson()
        m$kind = tson.scalar("WizardStepModel")
        m$namespace = tson.scalar(self$namespace)
        m$description = tson.scalar(self$description)
        m$appDesignType = tson.scalar(self$appDesignType)
        m$factors = lapply(self$factors, function(each) each$toTson())
        m$filters = lapply(self$filters, function(each) each$toTson())
        m$steps = lapply(self$steps, function(each) each$toTson())
        m$defaultFactors = lapply(self$defaultFactors, function(each) each$toTson())
        m$defaultFilters = lapply(self$defaultFilters, function(each) each$toTson())
        return(m)
    }))
tercen/teRcenApi documentation built on Feb. 8, 2024, 5:59 p.m.