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


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

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