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

      SubAccountUSDTFuturesDetailsObject
    },
    fromJSON = function(SubAccountUSDTFuturesDetailsJson) {
      SubAccountUSDTFuturesDetailsObject <- jsonlite::fromJSON(SubAccountUSDTFuturesDetailsJson)
      if (!is.null(SubAccountUSDTFuturesDetailsObject$`futureAccountResp`)) {
        futureAccountRespObject <- SubAccountUSDTFuturesDetailsFutureAccountResp$new()
        futureAccountRespObject$fromJSON(jsonlite::toJSON(SubAccountUSDTFuturesDetailsObject$futureAccountResp, auto_unbox = TRUE, digits = NA))
        self$`futureAccountResp` <- futureAccountRespObject
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`futureAccountResp`)) {
        sprintf(
        '"futureAccountResp":
        %s
        ',
        jsonlite::toJSON(self$`futureAccountResp`$toJSON(), auto_unbox=TRUE, digits = NA)
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(SubAccountUSDTFuturesDetailsJson) {
      SubAccountUSDTFuturesDetailsObject <- jsonlite::fromJSON(SubAccountUSDTFuturesDetailsJson)
      self$`futureAccountResp` <- SubAccountUSDTFuturesDetailsFutureAccountResp$new()$fromJSON(jsonlite::toJSON(SubAccountUSDTFuturesDetailsObject$futureAccountResp, auto_unbox = TRUE, digits = NA))
      self
    }
  )
)
grahamjwhite/binanceRapi documentation built on Nov. 22, 2022, 9:37 p.m.