R/inline_response20060_margin_trade_coeff_vo.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 InlineResponse20060MarginTradeCoeffVo
#'
#' @description InlineResponse20060MarginTradeCoeffVo Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field forceLiquidationBar  character 
#'
#' @field marginCallBar  character 
#'
#' @field normalBar  character 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
InlineResponse20060MarginTradeCoeffVo <- R6::R6Class(
  'InlineResponse20060MarginTradeCoeffVo',
  public = list(
    `forceLiquidationBar` = NULL,
    `marginCallBar` = NULL,
    `normalBar` = NULL,
    initialize = function(
        `forceLiquidationBar`, `marginCallBar`, `normalBar`, ...
    ) {
      local.optional.var <- list(...)
      if (!missing(`forceLiquidationBar`)) {
        stopifnot(is.character(`forceLiquidationBar`), length(`forceLiquidationBar`) == 1)
        self$`forceLiquidationBar` <- `forceLiquidationBar`
      }
      if (!missing(`marginCallBar`)) {
        stopifnot(is.character(`marginCallBar`), length(`marginCallBar`) == 1)
        self$`marginCallBar` <- `marginCallBar`
      }
      if (!missing(`normalBar`)) {
        stopifnot(is.character(`normalBar`), length(`normalBar`) == 1)
        self$`normalBar` <- `normalBar`
      }
    },
    toJSON = function() {
      InlineResponse20060MarginTradeCoeffVoObject <- list()
      if (!is.null(self$`forceLiquidationBar`)) {
        InlineResponse20060MarginTradeCoeffVoObject[['forceLiquidationBar']] <-
          self$`forceLiquidationBar`
      }
      if (!is.null(self$`marginCallBar`)) {
        InlineResponse20060MarginTradeCoeffVoObject[['marginCallBar']] <-
          self$`marginCallBar`
      }
      if (!is.null(self$`normalBar`)) {
        InlineResponse20060MarginTradeCoeffVoObject[['normalBar']] <-
          self$`normalBar`
      }

      InlineResponse20060MarginTradeCoeffVoObject
    },
    fromJSON = function(InlineResponse20060MarginTradeCoeffVoJson) {
      InlineResponse20060MarginTradeCoeffVoObject <- jsonlite::fromJSON(InlineResponse20060MarginTradeCoeffVoJson)
      if (!is.null(InlineResponse20060MarginTradeCoeffVoObject$`forceLiquidationBar`)) {
        self$`forceLiquidationBar` <- InlineResponse20060MarginTradeCoeffVoObject$`forceLiquidationBar`
      }
      if (!is.null(InlineResponse20060MarginTradeCoeffVoObject$`marginCallBar`)) {
        self$`marginCallBar` <- InlineResponse20060MarginTradeCoeffVoObject$`marginCallBar`
      }
      if (!is.null(InlineResponse20060MarginTradeCoeffVoObject$`normalBar`)) {
        self$`normalBar` <- InlineResponse20060MarginTradeCoeffVoObject$`normalBar`
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`forceLiquidationBar`)) {
        sprintf(
        '"forceLiquidationBar":
          "%s"
                ',
        self$`forceLiquidationBar`
        )},
        if (!is.null(self$`marginCallBar`)) {
        sprintf(
        '"marginCallBar":
          "%s"
                ',
        self$`marginCallBar`
        )},
        if (!is.null(self$`normalBar`)) {
        sprintf(
        '"normalBar":
          "%s"
                ',
        self$`normalBar`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(InlineResponse20060MarginTradeCoeffVoJson) {
      InlineResponse20060MarginTradeCoeffVoObject <- jsonlite::fromJSON(InlineResponse20060MarginTradeCoeffVoJson)
      self$`forceLiquidationBar` <- InlineResponse20060MarginTradeCoeffVoObject$`forceLiquidationBar`
      self$`marginCallBar` <- InlineResponse20060MarginTradeCoeffVoObject$`marginCallBar`
      self$`normalBar` <- InlineResponse20060MarginTradeCoeffVoObject$`normalBar`
      self
    }
  )
)
grahamjwhite/binanceRapi documentation built on Nov. 22, 2022, 9:37 p.m.