R/inline_response20056.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 InlineResponse20056
#'
#' @description InlineResponse20056 Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field balances  list( \link{InlineResponse20056Balances} ) 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
InlineResponse20056 <- R6::R6Class(
  'InlineResponse20056',
  public = list(
    `balances` = NULL,
    initialize = function(
        `balances`, ...
    ) {
      local.optional.var <- list(...)
      if (!missing(`balances`)) {
        stopifnot(is.vector(`balances`), length(`balances`) != 0)
        sapply(`balances`, function(x) stopifnot(R6::is.R6(x)))
        self$`balances` <- `balances`
      }
    },
    toJSON = function() {
      InlineResponse20056Object <- list()
      if (!is.null(self$`balances`)) {
        InlineResponse20056Object[['balances']] <-
          lapply(self$`balances`, function(x) x$toJSON())
      }

      InlineResponse20056Object
    },
    fromJSON = function(InlineResponse20056Json) {
      InlineResponse20056Object <- jsonlite::fromJSON(InlineResponse20056Json)
      if (!is.null(InlineResponse20056Object$`balances`)) {
        self$`balances` <- ApiClient$new()$deserializeObj(InlineResponse20056Object$`balances`, "array[InlineResponse20056Balances]", loadNamespace("binanceRapi"))
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`balances`)) {
        sprintf(
        '"balances":
        [%s]
',
        paste(sapply(self$`balances`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox=TRUE, digits = NA)), collapse=",")
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(InlineResponse20056Json) {
      InlineResponse20056Object <- jsonlite::fromJSON(InlineResponse20056Json)
      self$`balances` <- ApiClient$new()$deserializeObj(InlineResponse20056Object$`balances`, "array[InlineResponse20056Balances]", loadNamespace("binanceRapi"))
      self
    }
  )
)
grahamjwhite/binanceRapi documentation built on Nov. 22, 2022, 9:37 p.m.