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

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