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

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