R/inline_response20063_assets.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 InlineResponse20063Assets
#'
#' @description InlineResponse20063Assets Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field asset  character 
#'
#' @field initialMargin  character 
#'
#' @field maintenanceMargin  character 
#'
#' @field marginBalance  character 
#'
#' @field maxWithdrawAmount  character 
#'
#' @field openOrderInitialMargin  character 
#'
#' @field positionInitialMargin  character 
#'
#' @field unrealizedProfit  character 
#'
#' @field walletBalance  character 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
InlineResponse20063Assets <- R6::R6Class(
  'InlineResponse20063Assets',
  public = list(
    `asset` = NULL,
    `initialMargin` = NULL,
    `maintenanceMargin` = NULL,
    `marginBalance` = NULL,
    `maxWithdrawAmount` = NULL,
    `openOrderInitialMargin` = NULL,
    `positionInitialMargin` = NULL,
    `unrealizedProfit` = NULL,
    `walletBalance` = NULL,
    initialize = function(
        `asset`, `initialMargin`, `maintenanceMargin`, `marginBalance`, `maxWithdrawAmount`, `openOrderInitialMargin`, `positionInitialMargin`, `unrealizedProfit`, `walletBalance`, ...
    ) {
      local.optional.var <- list(...)
      if (!missing(`asset`)) {
        stopifnot(is.character(`asset`), length(`asset`) == 1)
        self$`asset` <- `asset`
      }
      if (!missing(`initialMargin`)) {
        stopifnot(is.character(`initialMargin`), length(`initialMargin`) == 1)
        self$`initialMargin` <- `initialMargin`
      }
      if (!missing(`maintenanceMargin`)) {
        stopifnot(is.character(`maintenanceMargin`), length(`maintenanceMargin`) == 1)
        self$`maintenanceMargin` <- `maintenanceMargin`
      }
      if (!missing(`marginBalance`)) {
        stopifnot(is.character(`marginBalance`), length(`marginBalance`) == 1)
        self$`marginBalance` <- `marginBalance`
      }
      if (!missing(`maxWithdrawAmount`)) {
        stopifnot(is.character(`maxWithdrawAmount`), length(`maxWithdrawAmount`) == 1)
        self$`maxWithdrawAmount` <- `maxWithdrawAmount`
      }
      if (!missing(`openOrderInitialMargin`)) {
        stopifnot(is.character(`openOrderInitialMargin`), length(`openOrderInitialMargin`) == 1)
        self$`openOrderInitialMargin` <- `openOrderInitialMargin`
      }
      if (!missing(`positionInitialMargin`)) {
        stopifnot(is.character(`positionInitialMargin`), length(`positionInitialMargin`) == 1)
        self$`positionInitialMargin` <- `positionInitialMargin`
      }
      if (!missing(`unrealizedProfit`)) {
        stopifnot(is.character(`unrealizedProfit`), length(`unrealizedProfit`) == 1)
        self$`unrealizedProfit` <- `unrealizedProfit`
      }
      if (!missing(`walletBalance`)) {
        stopifnot(is.character(`walletBalance`), length(`walletBalance`) == 1)
        self$`walletBalance` <- `walletBalance`
      }
    },
    toJSON = function() {
      InlineResponse20063AssetsObject <- list()
      if (!is.null(self$`asset`)) {
        InlineResponse20063AssetsObject[['asset']] <-
          self$`asset`
      }
      if (!is.null(self$`initialMargin`)) {
        InlineResponse20063AssetsObject[['initialMargin']] <-
          self$`initialMargin`
      }
      if (!is.null(self$`maintenanceMargin`)) {
        InlineResponse20063AssetsObject[['maintenanceMargin']] <-
          self$`maintenanceMargin`
      }
      if (!is.null(self$`marginBalance`)) {
        InlineResponse20063AssetsObject[['marginBalance']] <-
          self$`marginBalance`
      }
      if (!is.null(self$`maxWithdrawAmount`)) {
        InlineResponse20063AssetsObject[['maxWithdrawAmount']] <-
          self$`maxWithdrawAmount`
      }
      if (!is.null(self$`openOrderInitialMargin`)) {
        InlineResponse20063AssetsObject[['openOrderInitialMargin']] <-
          self$`openOrderInitialMargin`
      }
      if (!is.null(self$`positionInitialMargin`)) {
        InlineResponse20063AssetsObject[['positionInitialMargin']] <-
          self$`positionInitialMargin`
      }
      if (!is.null(self$`unrealizedProfit`)) {
        InlineResponse20063AssetsObject[['unrealizedProfit']] <-
          self$`unrealizedProfit`
      }
      if (!is.null(self$`walletBalance`)) {
        InlineResponse20063AssetsObject[['walletBalance']] <-
          self$`walletBalance`
      }

      InlineResponse20063AssetsObject
    },
    fromJSON = function(InlineResponse20063AssetsJson) {
      InlineResponse20063AssetsObject <- jsonlite::fromJSON(InlineResponse20063AssetsJson)
      if (!is.null(InlineResponse20063AssetsObject$`asset`)) {
        self$`asset` <- InlineResponse20063AssetsObject$`asset`
      }
      if (!is.null(InlineResponse20063AssetsObject$`initialMargin`)) {
        self$`initialMargin` <- InlineResponse20063AssetsObject$`initialMargin`
      }
      if (!is.null(InlineResponse20063AssetsObject$`maintenanceMargin`)) {
        self$`maintenanceMargin` <- InlineResponse20063AssetsObject$`maintenanceMargin`
      }
      if (!is.null(InlineResponse20063AssetsObject$`marginBalance`)) {
        self$`marginBalance` <- InlineResponse20063AssetsObject$`marginBalance`
      }
      if (!is.null(InlineResponse20063AssetsObject$`maxWithdrawAmount`)) {
        self$`maxWithdrawAmount` <- InlineResponse20063AssetsObject$`maxWithdrawAmount`
      }
      if (!is.null(InlineResponse20063AssetsObject$`openOrderInitialMargin`)) {
        self$`openOrderInitialMargin` <- InlineResponse20063AssetsObject$`openOrderInitialMargin`
      }
      if (!is.null(InlineResponse20063AssetsObject$`positionInitialMargin`)) {
        self$`positionInitialMargin` <- InlineResponse20063AssetsObject$`positionInitialMargin`
      }
      if (!is.null(InlineResponse20063AssetsObject$`unrealizedProfit`)) {
        self$`unrealizedProfit` <- InlineResponse20063AssetsObject$`unrealizedProfit`
      }
      if (!is.null(InlineResponse20063AssetsObject$`walletBalance`)) {
        self$`walletBalance` <- InlineResponse20063AssetsObject$`walletBalance`
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`asset`)) {
        sprintf(
        '"asset":
          "%s"
                ',
        self$`asset`
        )},
        if (!is.null(self$`initialMargin`)) {
        sprintf(
        '"initialMargin":
          "%s"
                ',
        self$`initialMargin`
        )},
        if (!is.null(self$`maintenanceMargin`)) {
        sprintf(
        '"maintenanceMargin":
          "%s"
                ',
        self$`maintenanceMargin`
        )},
        if (!is.null(self$`marginBalance`)) {
        sprintf(
        '"marginBalance":
          "%s"
                ',
        self$`marginBalance`
        )},
        if (!is.null(self$`maxWithdrawAmount`)) {
        sprintf(
        '"maxWithdrawAmount":
          "%s"
                ',
        self$`maxWithdrawAmount`
        )},
        if (!is.null(self$`openOrderInitialMargin`)) {
        sprintf(
        '"openOrderInitialMargin":
          "%s"
                ',
        self$`openOrderInitialMargin`
        )},
        if (!is.null(self$`positionInitialMargin`)) {
        sprintf(
        '"positionInitialMargin":
          "%s"
                ',
        self$`positionInitialMargin`
        )},
        if (!is.null(self$`unrealizedProfit`)) {
        sprintf(
        '"unrealizedProfit":
          "%s"
                ',
        self$`unrealizedProfit`
        )},
        if (!is.null(self$`walletBalance`)) {
        sprintf(
        '"walletBalance":
          "%s"
                ',
        self$`walletBalance`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(InlineResponse20063AssetsJson) {
      InlineResponse20063AssetsObject <- jsonlite::fromJSON(InlineResponse20063AssetsJson)
      self$`asset` <- InlineResponse20063AssetsObject$`asset`
      self$`initialMargin` <- InlineResponse20063AssetsObject$`initialMargin`
      self$`maintenanceMargin` <- InlineResponse20063AssetsObject$`maintenanceMargin`
      self$`marginBalance` <- InlineResponse20063AssetsObject$`marginBalance`
      self$`maxWithdrawAmount` <- InlineResponse20063AssetsObject$`maxWithdrawAmount`
      self$`openOrderInitialMargin` <- InlineResponse20063AssetsObject$`openOrderInitialMargin`
      self$`positionInitialMargin` <- InlineResponse20063AssetsObject$`positionInitialMargin`
      self$`unrealizedProfit` <- InlineResponse20063AssetsObject$`unrealizedProfit`
      self$`walletBalance` <- InlineResponse20063AssetsObject$`walletBalance`
      self
    }
  )
)
grahamjwhite/binanceRapi documentation built on Nov. 22, 2022, 9:37 p.m.