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


#' JsonFormClusters Class
#'
#' @field kind 
#' @field name 
#' @field opts 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
JsonFormClusters <- R6::R6Class(
  'JsonFormClusters',
  public = list(
    `kind` = NULL,
    `name` = NULL,
    `opts` = NULL,
    initialize = function(`kind`, `name`, `opts`){
      if (!missing(`kind`)) {
        stopifnot(is.character(`kind`), length(`kind`) == 1)
        self$`kind` <- `kind`
      }
      if (!missing(`name`)) {
        stopifnot(is.character(`name`), length(`name`) == 1)
        self$`name` <- `name`
      }
      if (!missing(`opts`)) {
        stopifnot(is.character(`opts`), length(`opts`) == 1)
        self$`opts` <- `opts`
      }
    },
    toJSON = function() {
      JsonFormClustersObject <- list()
      if (!is.null(self$`kind`)) {
        JsonFormClustersObject[['kind']] <- self$`kind`
      }
      if (!is.null(self$`name`)) {
        JsonFormClustersObject[['name']] <- self$`name`
      }
      if (!is.null(self$`opts`)) {
        JsonFormClustersObject[['opts']] <- self$`opts`
      }

      JsonFormClustersObject
    },
    fromJSON = function(JsonFormClustersJson) {
      JsonFormClustersObject <- jsonlite::fromJSON(JsonFormClustersJson)
      if (!is.null(JsonFormClustersObject$`kind`)) {
        self$`kind` <- JsonFormClustersObject$`kind`
      }
      if (!is.null(JsonFormClustersObject$`name`)) {
        self$`name` <- JsonFormClustersObject$`name`
      }
      if (!is.null(JsonFormClustersObject$`opts`)) {
        self$`opts` <- JsonFormClustersObject$`opts`
      }
    },
    toJSONString = function() {
       sprintf(
        '{
           "kind": %s,
           "name": %s,
           "opts": %s
        }',
        self$`kind`,
        self$`name`,
        self$`opts`
      )
    },
    fromJSONString = function(JsonFormClustersJson) {
      JsonFormClustersObject <- jsonlite::fromJSON(JsonFormClustersJson)
      self$`kind` <- JsonFormClustersObject$`kind`
      self$`name` <- JsonFormClustersObject$`name`
      self$`opts` <- JsonFormClustersObject$`opts`
    }
  )
)
riteshkarvaloc/dkubeR documentation built on Feb. 25, 2021, 9:28 p.m.