R/inline_response20040.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 InlineResponse20040
#'
#' @description InlineResponse20040 Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field data  \link{InlineResponse20040Data} 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
InlineResponse20040 <- R6::R6Class(
  'InlineResponse20040',
  public = list(
    `data` = NULL,
    initialize = function(
        `data`, ...
    ) {
      local.optional.var <- list(...)
      if (!missing(`data`)) {
        stopifnot(R6::is.R6(`data`))
        self$`data` <- `data`
      }
    },
    toJSON = function() {
      InlineResponse20040Object <- list()
      if (!is.null(self$`data`)) {
        InlineResponse20040Object[['data']] <-
          self$`data`$toJSON()
      }

      InlineResponse20040Object
    },
    fromJSON = function(InlineResponse20040Json) {
      InlineResponse20040Object <- jsonlite::fromJSON(InlineResponse20040Json)
      if (!is.null(InlineResponse20040Object$`data`)) {
        dataObject <- InlineResponse20040Data$new()
        dataObject$fromJSON(jsonlite::toJSON(InlineResponse20040Object$data, auto_unbox = TRUE, digits = NA))
        self$`data` <- dataObject
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        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(InlineResponse20040Json) {
      InlineResponse20040Object <- jsonlite::fromJSON(InlineResponse20040Json)
      self$`data` <- InlineResponse20040Data$new()$fromJSON(jsonlite::toJSON(InlineResponse20040Object$data, auto_unbox = TRUE, digits = NA))
      self
    }
  )
)
grahamjwhite/binanceRapi documentation built on Nov. 22, 2022, 9:37 p.m.