R/UserCollectionJobs.r

# Dkube api server
#
# No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
#
# OpenAPI spec version: 2.2.1.11
# 
# Generated by: https://github.com/swagger-api/swagger-codegen.git


#' UserCollectionJobs Class
#'
#' @field notebooks 
#' @field jobs 
#' @field inferences 
#' @field preprocessing 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
UserCollectionJobs <- R6::R6Class(
  'UserCollectionJobs',
  public = list(
    `notebooks` = NULL,
    `jobs` = NULL,
    `inferences` = NULL,
    `preprocessing` = NULL,
    initialize = function(`notebooks`, `jobs`, `inferences`, `preprocessing`){
      if (!missing(`notebooks`)) {
        stopifnot(R6::is.R6(`notebooks`))
        self$`notebooks` <- `notebooks`
      }
      if (!missing(`jobs`)) {
        stopifnot(R6::is.R6(`jobs`))
        self$`jobs` <- `jobs`
      }
      if (!missing(`inferences`)) {
        stopifnot(R6::is.R6(`inferences`))
        self$`inferences` <- `inferences`
      }
      if (!missing(`preprocessing`)) {
        stopifnot(R6::is.R6(`preprocessing`))
        self$`preprocessing` <- `preprocessing`
      }
    },
    toJSON = function() {
      UserCollectionJobsObject <- list()
      if (!is.null(self$`notebooks`)) {
        UserCollectionJobsObject[['notebooks']] <- self$`notebooks`$toJSON()
      }
      if (!is.null(self$`jobs`)) {
        UserCollectionJobsObject[['jobs']] <- self$`jobs`$toJSON()
      }
      if (!is.null(self$`inferences`)) {
        UserCollectionJobsObject[['inferences']] <- self$`inferences`$toJSON()
      }
      if (!is.null(self$`preprocessing`)) {
        UserCollectionJobsObject[['preprocessing']] <- self$`preprocessing`$toJSON()
      }

      UserCollectionJobsObject
    },
    fromJSON = function(UserCollectionJobsJson) {
      UserCollectionJobsObject <- jsonlite::fromJSON(UserCollectionJobsJson)
      if (!is.null(UserCollectionJobsObject$`notebooks`)) {
        notebooksObject <- UserCollectionJobsNotebooks$new()
        notebooksObject$fromJSON(jsonlite::toJSON(UserCollectionJobsObject$notebooks, auto_unbox = TRUE))
        self$`notebooks` <- notebooksObject
      }
      if (!is.null(UserCollectionJobsObject$`jobs`)) {
        jobsObject <- UserCollectionJobsNotebooks$new()
        jobsObject$fromJSON(jsonlite::toJSON(UserCollectionJobsObject$jobs, auto_unbox = TRUE))
        self$`jobs` <- jobsObject
      }
      if (!is.null(UserCollectionJobsObject$`inferences`)) {
        inferencesObject <- UserCollectionJobsNotebooks$new()
        inferencesObject$fromJSON(jsonlite::toJSON(UserCollectionJobsObject$inferences, auto_unbox = TRUE))
        self$`inferences` <- inferencesObject
      }
      if (!is.null(UserCollectionJobsObject$`preprocessing`)) {
        preprocessingObject <- UserCollectionJobsNotebooks$new()
        preprocessingObject$fromJSON(jsonlite::toJSON(UserCollectionJobsObject$preprocessing, auto_unbox = TRUE))
        self$`preprocessing` <- preprocessingObject
      }
    },
    toJSONString = function() {
       sprintf(
        '{
           "notebooks": %s,
           "jobs": %s,
           "inferences": %s,
           "preprocessing": %s
        }',
        self$`notebooks`$toJSON(),
        self$`jobs`$toJSON(),
        self$`inferences`$toJSON(),
        self$`preprocessing`$toJSON()
      )
    },
    fromJSONString = function(UserCollectionJobsJson) {
      UserCollectionJobsObject <- jsonlite::fromJSON(UserCollectionJobsJson)
      UserCollectionJobsNotebooksObject <- UserCollectionJobsNotebooks$new()
      self$`notebooks` <- UserCollectionJobsNotebooksObject$fromJSON(jsonlite::toJSON(UserCollectionJobsObject$notebooks, auto_unbox = TRUE))
      UserCollectionJobsNotebooksObject <- UserCollectionJobsNotebooks$new()
      self$`jobs` <- UserCollectionJobsNotebooksObject$fromJSON(jsonlite::toJSON(UserCollectionJobsObject$jobs, auto_unbox = TRUE))
      UserCollectionJobsNotebooksObject <- UserCollectionJobsNotebooks$new()
      self$`inferences` <- UserCollectionJobsNotebooksObject$fromJSON(jsonlite::toJSON(UserCollectionJobsObject$inferences, auto_unbox = TRUE))
      UserCollectionJobsNotebooksObject <- UserCollectionJobsNotebooks$new()
      self$`preprocessing` <- UserCollectionJobsNotebooksObject$fromJSON(jsonlite::toJSON(UserCollectionJobsObject$preprocessing, auto_unbox = TRUE))
    }
  )
)
riteshkarvaloc/dkubeR documentation built on Feb. 25, 2021, 9:28 p.m.