R/Data24.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


#' Data24 Class
#'
#' @field upsert 
#' @field poolname 
#' @field pooltype 
#' @field ndevices 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
Data24 <- R6::R6Class(
  'Data24',
  public = list(
    `upsert` = NULL,
    `poolname` = NULL,
    `pooltype` = NULL,
    `ndevices` = NULL,
    initialize = function(`upsert`, `poolname`, `pooltype`, `ndevices`){
      if (!missing(`upsert`)) {
        self$`upsert` <- `upsert`
      }
      if (!missing(`poolname`)) {
        stopifnot(is.character(`poolname`), length(`poolname`) == 1)
        self$`poolname` <- `poolname`
      }
      if (!missing(`pooltype`)) {
        stopifnot(is.character(`pooltype`), length(`pooltype`) == 1)
        self$`pooltype` <- `pooltype`
      }
      if (!missing(`ndevices`)) {
        stopifnot(is.numeric(`ndevices`), length(`ndevices`) == 1)
        self$`ndevices` <- `ndevices`
      }
    },
    toJSON = function() {
      Data24Object <- list()
      if (!is.null(self$`upsert`)) {
        Data24Object[['upsert']] <- self$`upsert`
      }
      if (!is.null(self$`poolname`)) {
        Data24Object[['poolname']] <- self$`poolname`
      }
      if (!is.null(self$`pooltype`)) {
        Data24Object[['pooltype']] <- self$`pooltype`
      }
      if (!is.null(self$`ndevices`)) {
        Data24Object[['ndevices']] <- self$`ndevices`
      }

      Data24Object
    },
    fromJSON = function(Data24Json) {
      Data24Object <- jsonlite::fromJSON(Data24Json)
      if (!is.null(Data24Object$`upsert`)) {
        self$`upsert` <- Data24Object$`upsert`
      }
      if (!is.null(Data24Object$`poolname`)) {
        self$`poolname` <- Data24Object$`poolname`
      }
      if (!is.null(Data24Object$`pooltype`)) {
        self$`pooltype` <- Data24Object$`pooltype`
      }
      if (!is.null(Data24Object$`ndevices`)) {
        self$`ndevices` <- Data24Object$`ndevices`
      }
    },
    toJSONString = function() {
       sprintf(
        '{
           "upsert": %s,
           "poolname": %s,
           "pooltype": %s,
           "ndevices": %d
        }',
        self$`upsert`,
        self$`poolname`,
        self$`pooltype`,
        self$`ndevices`
      )
    },
    fromJSONString = function(Data24Json) {
      Data24Object <- jsonlite::fromJSON(Data24Json)
      self$`upsert` <- Data24Object$`upsert`
      self$`poolname` <- Data24Object$`poolname`
      self$`pooltype` <- Data24Object$`pooltype`
      self$`ndevices` <- Data24Object$`ndevices`
    }
  )
)
riteshkarvaloc/dkubeR documentation built on Feb. 25, 2021, 9:28 p.m.