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


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

      CustomContainerModelObject
    },
    fromJSON = function(CustomContainerModelJson) {
      CustomContainerModelObject <- jsonlite::fromJSON(CustomContainerModelJson)
      if (!is.null(CustomContainerModelObject$`image`)) {
        imageObject <- CustomContainerModelImage$new()
        imageObject$fromJSON(jsonlite::toJSON(CustomContainerModelObject$image, auto_unbox = TRUE))
        self$`image` <- imageObject
      }
    },
    toJSONString = function() {
       sprintf(
        '{
           "image": %s
        }',
        self$`image`$toJSON()
      )
    },
    fromJSONString = function(CustomContainerModelJson) {
      CustomContainerModelObject <- jsonlite::fromJSON(CustomContainerModelJson)
      CustomContainerModelImageObject <- CustomContainerModelImage$new()
      self$`image` <- CustomContainerModelImageObject$fromJSON(jsonlite::toJSON(CustomContainerModelObject$image, auto_unbox = TRUE))
    }
  )
)
riteshkarvaloc/dkubeR documentation built on Feb. 25, 2021, 9:28 p.m.