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

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