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

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