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

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