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


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

      DkubeContainerModelFrameworkObject
    },
    fromJSON = function(DkubeContainerModelFrameworkJson) {
      DkubeContainerModelFrameworkObject <- jsonlite::fromJSON(DkubeContainerModelFrameworkJson)
      if (!is.null(DkubeContainerModelFrameworkObject$`choice`)) {
        self$`choice` <- DkubeContainerModelFrameworkObject$`choice`
      }
      if (!is.null(DkubeContainerModelFrameworkObject$`details`)) {
        detailsObject <- DkubeContainerModelFrameworkDetails$new()
        detailsObject$fromJSON(jsonlite::toJSON(DkubeContainerModelFrameworkObject$details, auto_unbox = TRUE))
        self$`details` <- detailsObject
      }
    },
    toJSONString = function() {
       sprintf(
        '{
           "choice": %s,
           "details": %s
        }',
        self$`choice`,
        self$`details`$toJSON()
      )
    },
    fromJSONString = function(DkubeContainerModelFrameworkJson) {
      DkubeContainerModelFrameworkObject <- jsonlite::fromJSON(DkubeContainerModelFrameworkJson)
      self$`choice` <- DkubeContainerModelFrameworkObject$`choice`
      DkubeContainerModelFrameworkDetailsObject <- DkubeContainerModelFrameworkDetails$new()
      self$`details` <- DkubeContainerModelFrameworkDetailsObject$fromJSON(jsonlite::toJSON(DkubeContainerModelFrameworkObject$details, auto_unbox = TRUE))
    }
  )
)
riteshkarvaloc/dkubeR documentation built on Feb. 25, 2021, 9:28 p.m.