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


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

      InlineResponse20010Object
    },
    fromJSON = function(InlineResponse20010Json) {
      InlineResponse20010Object <- jsonlite::fromJSON(InlineResponse20010Json)
      if (!is.null(InlineResponse20010Object$`response`)) {
        responseObject <- ApiResponse$new()
        responseObject$fromJSON(jsonlite::toJSON(InlineResponse20010Object$response, auto_unbox = TRUE))
        self$`response` <- responseObject
      }
      if (!is.null(InlineResponse20010Object$`data`)) {
        dataObject <- TokenInfo$new()
        dataObject$fromJSON(jsonlite::toJSON(InlineResponse20010Object$data, auto_unbox = TRUE))
        self$`data` <- dataObject
      }
    },
    toJSONString = function() {
       sprintf(
        '{
           "response": %s,
           "data": %s
        }',
        self$`response`$toJSON(),
        self$`data`$toJSON()
      )
    },
    fromJSONString = function(InlineResponse20010Json) {
      InlineResponse20010Object <- jsonlite::fromJSON(InlineResponse20010Json)
      ApiResponseObject <- ApiResponse$new()
      self$`response` <- ApiResponseObject$fromJSON(jsonlite::toJSON(InlineResponse20010Object$response, auto_unbox = TRUE))
      TokenInfoObject <- TokenInfo$new()
      self$`data` <- TokenInfoObject$fromJSON(jsonlite::toJSON(InlineResponse20010Object$data, auto_unbox = TRUE))
    }
  )
)
riteshkarvaloc/dkubeR documentation built on Feb. 25, 2021, 9:28 p.m.