R/inline_response200136.R

# Binance Public Spot API
#
# OpenAPI Specifications for the Binance Public Spot API  API documents:   - [https://github.com/binance/binance-spot-api-docs](https://github.com/binance/binance-spot-api-docs)   - [https://binance-docs.github.io/apidocs/spot/en](https://binance-docs.github.io/apidocs/spot/en)
#
# The version of the OpenAPI document: 1.0
# 
# Generated by: https://openapi-generator.tech

#' @docType class
#' @title InlineResponse200136
#'
#' @description InlineResponse200136 Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field status  character 
#'
#' @field type  character 
#'
#' @field code  character 
#'
#' @field data  \link{InlineResponse200136Data} 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
InlineResponse200136 <- R6::R6Class(
  'InlineResponse200136',
  public = list(
    `status` = NULL,
    `type` = NULL,
    `code` = NULL,
    `data` = NULL,
    initialize = function(
        `status`, `type`, `code`, `data`, ...
    ) {
      local.optional.var <- list(...)
      if (!missing(`status`)) {
        stopifnot(is.character(`status`), length(`status`) == 1)
        self$`status` <- `status`
      }
      if (!missing(`type`)) {
        stopifnot(is.character(`type`), length(`type`) == 1)
        self$`type` <- `type`
      }
      if (!missing(`code`)) {
        stopifnot(is.character(`code`), length(`code`) == 1)
        self$`code` <- `code`
      }
      if (!missing(`data`)) {
        stopifnot(R6::is.R6(`data`))
        self$`data` <- `data`
      }
    },
    toJSON = function() {
      InlineResponse200136Object <- list()
      if (!is.null(self$`status`)) {
        InlineResponse200136Object[['status']] <-
          self$`status`
      }
      if (!is.null(self$`type`)) {
        InlineResponse200136Object[['type']] <-
          self$`type`
      }
      if (!is.null(self$`code`)) {
        InlineResponse200136Object[['code']] <-
          self$`code`
      }
      if (!is.null(self$`data`)) {
        InlineResponse200136Object[['data']] <-
          self$`data`$toJSON()
      }

      InlineResponse200136Object
    },
    fromJSON = function(InlineResponse200136Json) {
      InlineResponse200136Object <- jsonlite::fromJSON(InlineResponse200136Json)
      if (!is.null(InlineResponse200136Object$`status`)) {
        self$`status` <- InlineResponse200136Object$`status`
      }
      if (!is.null(InlineResponse200136Object$`type`)) {
        self$`type` <- InlineResponse200136Object$`type`
      }
      if (!is.null(InlineResponse200136Object$`code`)) {
        self$`code` <- InlineResponse200136Object$`code`
      }
      if (!is.null(InlineResponse200136Object$`data`)) {
        dataObject <- InlineResponse200136Data$new()
        dataObject$fromJSON(jsonlite::toJSON(InlineResponse200136Object$data, auto_unbox = TRUE, digits = NA))
        self$`data` <- dataObject
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`status`)) {
        sprintf(
        '"status":
          "%s"
                ',
        self$`status`
        )},
        if (!is.null(self$`type`)) {
        sprintf(
        '"type":
          "%s"
                ',
        self$`type`
        )},
        if (!is.null(self$`code`)) {
        sprintf(
        '"code":
          "%s"
                ',
        self$`code`
        )},
        if (!is.null(self$`data`)) {
        sprintf(
        '"data":
        %s
        ',
        jsonlite::toJSON(self$`data`$toJSON(), auto_unbox=TRUE, digits = NA)
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(InlineResponse200136Json) {
      InlineResponse200136Object <- jsonlite::fromJSON(InlineResponse200136Json)
      self$`status` <- InlineResponse200136Object$`status`
      self$`type` <- InlineResponse200136Object$`type`
      self$`code` <- InlineResponse200136Object$`code`
      self$`data` <- InlineResponse200136Data$new()$fromJSON(jsonlite::toJSON(InlineResponse200136Object$data, auto_unbox = TRUE, digits = NA))
      self
    }
  )
)
grahamjwhite/binanceRapi documentation built on Nov. 22, 2022, 9:37 p.m.