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

      InlineResponse20032Object
    },
    fromJSON = function(InlineResponse20032Json) {
      InlineResponse20032Object <- jsonlite::fromJSON(InlineResponse20032Json)
      if (!is.null(InlineResponse20032Object$`rateLimitType`)) {
        self$`rateLimitType` <- InlineResponse20032Object$`rateLimitType`
      }
      if (!is.null(InlineResponse20032Object$`interval`)) {
        self$`interval` <- InlineResponse20032Object$`interval`
      }
      if (!is.null(InlineResponse20032Object$`intervalNum`)) {
        self$`intervalNum` <- InlineResponse20032Object$`intervalNum`
      }
      if (!is.null(InlineResponse20032Object$`limit`)) {
        self$`limit` <- InlineResponse20032Object$`limit`
      }
      if (!is.null(InlineResponse20032Object$`count`)) {
        self$`count` <- InlineResponse20032Object$`count`
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`rateLimitType`)) {
        sprintf(
        '"rateLimitType":
          "%s"
                ',
        self$`rateLimitType`
        )},
        if (!is.null(self$`interval`)) {
        sprintf(
        '"interval":
          "%s"
                ',
        self$`interval`
        )},
        if (!is.null(self$`intervalNum`)) {
        sprintf(
        '"intervalNum":
          %d
                ',
        self$`intervalNum`
        )},
        if (!is.null(self$`limit`)) {
        sprintf(
        '"limit":
          %d
                ',
        self$`limit`
        )},
        if (!is.null(self$`count`)) {
        sprintf(
        '"count":
          %d
                ',
        self$`count`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(InlineResponse20032Json) {
      InlineResponse20032Object <- jsonlite::fromJSON(InlineResponse20032Json)
      self$`rateLimitType` <- InlineResponse20032Object$`rateLimitType`
      self$`interval` <- InlineResponse20032Object$`interval`
      self$`intervalNum` <- InlineResponse20032Object$`intervalNum`
      self$`limit` <- InlineResponse20032Object$`limit`
      self$`count` <- InlineResponse20032Object$`count`
      self
    }
  )
)
grahamjwhite/binanceRapi documentation built on Nov. 22, 2022, 9:37 p.m.