R/inline_response20034.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 InlineResponse20034
#'
#' @description InlineResponse20034 Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field coin  character 
#'
#' @field depositAllEnable  character 
#'
#' @field free  character 
#'
#' @field freeze  character 
#'
#' @field ipoable  character 
#'
#' @field ipoing  character 
#'
#' @field isLegalMoney  character 
#'
#' @field locked  character 
#'
#' @field name  character 
#'
#' @field networkList  list( \link{SapiV1CapitalConfigGetallNetworkList} ) 
#'
#' @field storage  character 
#'
#' @field trading  character 
#'
#' @field withdrawAllEnable  character 
#'
#' @field withdrawing  character 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
InlineResponse20034 <- R6::R6Class(
  'InlineResponse20034',
  public = list(
    `coin` = NULL,
    `depositAllEnable` = NULL,
    `free` = NULL,
    `freeze` = NULL,
    `ipoable` = NULL,
    `ipoing` = NULL,
    `isLegalMoney` = NULL,
    `locked` = NULL,
    `name` = NULL,
    `networkList` = NULL,
    `storage` = NULL,
    `trading` = NULL,
    `withdrawAllEnable` = NULL,
    `withdrawing` = NULL,
    initialize = function(
        `coin`, `depositAllEnable`, `free`, `freeze`, `ipoable`, `ipoing`, `isLegalMoney`, `locked`, `name`, `networkList`, `storage`, `trading`, `withdrawAllEnable`, `withdrawing`, ...
    ) {
      local.optional.var <- list(...)
      if (!missing(`coin`)) {
        stopifnot(is.character(`coin`), length(`coin`) == 1)
        self$`coin` <- `coin`
      }
      if (!missing(`depositAllEnable`)) {
        stopifnot(is.logical(`depositAllEnable`), length(`depositAllEnable`) == 1)
        self$`depositAllEnable` <- `depositAllEnable`
      }
      if (!missing(`free`)) {
        stopifnot(is.character(`free`), length(`free`) == 1)
        self$`free` <- `free`
      }
      if (!missing(`freeze`)) {
        stopifnot(is.character(`freeze`), length(`freeze`) == 1)
        self$`freeze` <- `freeze`
      }
      if (!missing(`ipoable`)) {
        stopifnot(is.character(`ipoable`), length(`ipoable`) == 1)
        self$`ipoable` <- `ipoable`
      }
      if (!missing(`ipoing`)) {
        stopifnot(is.character(`ipoing`), length(`ipoing`) == 1)
        self$`ipoing` <- `ipoing`
      }
      if (!missing(`isLegalMoney`)) {
        stopifnot(is.logical(`isLegalMoney`), length(`isLegalMoney`) == 1)
        self$`isLegalMoney` <- `isLegalMoney`
      }
      if (!missing(`locked`)) {
        stopifnot(is.character(`locked`), length(`locked`) == 1)
        self$`locked` <- `locked`
      }
      if (!missing(`name`)) {
        stopifnot(is.character(`name`), length(`name`) == 1)
        self$`name` <- `name`
      }
      if (!missing(`networkList`)) {
        stopifnot(is.vector(`networkList`), length(`networkList`) != 0)
        sapply(`networkList`, function(x) stopifnot(R6::is.R6(x)))
        self$`networkList` <- `networkList`
      }
      if (!missing(`storage`)) {
        stopifnot(is.character(`storage`), length(`storage`) == 1)
        self$`storage` <- `storage`
      }
      if (!missing(`trading`)) {
        stopifnot(is.logical(`trading`), length(`trading`) == 1)
        self$`trading` <- `trading`
      }
      if (!missing(`withdrawAllEnable`)) {
        stopifnot(is.logical(`withdrawAllEnable`), length(`withdrawAllEnable`) == 1)
        self$`withdrawAllEnable` <- `withdrawAllEnable`
      }
      if (!missing(`withdrawing`)) {
        stopifnot(is.character(`withdrawing`), length(`withdrawing`) == 1)
        self$`withdrawing` <- `withdrawing`
      }
    },
    toJSON = function() {
      InlineResponse20034Object <- list()
      if (!is.null(self$`coin`)) {
        InlineResponse20034Object[['coin']] <-
          self$`coin`
      }
      if (!is.null(self$`depositAllEnable`)) {
        InlineResponse20034Object[['depositAllEnable']] <-
          self$`depositAllEnable`
      }
      if (!is.null(self$`free`)) {
        InlineResponse20034Object[['free']] <-
          self$`free`
      }
      if (!is.null(self$`freeze`)) {
        InlineResponse20034Object[['freeze']] <-
          self$`freeze`
      }
      if (!is.null(self$`ipoable`)) {
        InlineResponse20034Object[['ipoable']] <-
          self$`ipoable`
      }
      if (!is.null(self$`ipoing`)) {
        InlineResponse20034Object[['ipoing']] <-
          self$`ipoing`
      }
      if (!is.null(self$`isLegalMoney`)) {
        InlineResponse20034Object[['isLegalMoney']] <-
          self$`isLegalMoney`
      }
      if (!is.null(self$`locked`)) {
        InlineResponse20034Object[['locked']] <-
          self$`locked`
      }
      if (!is.null(self$`name`)) {
        InlineResponse20034Object[['name']] <-
          self$`name`
      }
      if (!is.null(self$`networkList`)) {
        InlineResponse20034Object[['networkList']] <-
          lapply(self$`networkList`, function(x) x$toJSON())
      }
      if (!is.null(self$`storage`)) {
        InlineResponse20034Object[['storage']] <-
          self$`storage`
      }
      if (!is.null(self$`trading`)) {
        InlineResponse20034Object[['trading']] <-
          self$`trading`
      }
      if (!is.null(self$`withdrawAllEnable`)) {
        InlineResponse20034Object[['withdrawAllEnable']] <-
          self$`withdrawAllEnable`
      }
      if (!is.null(self$`withdrawing`)) {
        InlineResponse20034Object[['withdrawing']] <-
          self$`withdrawing`
      }

      InlineResponse20034Object
    },
    fromJSON = function(InlineResponse20034Json) {
      InlineResponse20034Object <- jsonlite::fromJSON(InlineResponse20034Json)
      if (!is.null(InlineResponse20034Object$`coin`)) {
        self$`coin` <- InlineResponse20034Object$`coin`
      }
      if (!is.null(InlineResponse20034Object$`depositAllEnable`)) {
        self$`depositAllEnable` <- InlineResponse20034Object$`depositAllEnable`
      }
      if (!is.null(InlineResponse20034Object$`free`)) {
        self$`free` <- InlineResponse20034Object$`free`
      }
      if (!is.null(InlineResponse20034Object$`freeze`)) {
        self$`freeze` <- InlineResponse20034Object$`freeze`
      }
      if (!is.null(InlineResponse20034Object$`ipoable`)) {
        self$`ipoable` <- InlineResponse20034Object$`ipoable`
      }
      if (!is.null(InlineResponse20034Object$`ipoing`)) {
        self$`ipoing` <- InlineResponse20034Object$`ipoing`
      }
      if (!is.null(InlineResponse20034Object$`isLegalMoney`)) {
        self$`isLegalMoney` <- InlineResponse20034Object$`isLegalMoney`
      }
      if (!is.null(InlineResponse20034Object$`locked`)) {
        self$`locked` <- InlineResponse20034Object$`locked`
      }
      if (!is.null(InlineResponse20034Object$`name`)) {
        self$`name` <- InlineResponse20034Object$`name`
      }
      if (!is.null(InlineResponse20034Object$`networkList`)) {
        self$`networkList` <- ApiClient$new()$deserializeObj(InlineResponse20034Object$`networkList`, "array[SapiV1CapitalConfigGetallNetworkList]", loadNamespace("binanceRapi"))
      }
      if (!is.null(InlineResponse20034Object$`storage`)) {
        self$`storage` <- InlineResponse20034Object$`storage`
      }
      if (!is.null(InlineResponse20034Object$`trading`)) {
        self$`trading` <- InlineResponse20034Object$`trading`
      }
      if (!is.null(InlineResponse20034Object$`withdrawAllEnable`)) {
        self$`withdrawAllEnable` <- InlineResponse20034Object$`withdrawAllEnable`
      }
      if (!is.null(InlineResponse20034Object$`withdrawing`)) {
        self$`withdrawing` <- InlineResponse20034Object$`withdrawing`
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`coin`)) {
        sprintf(
        '"coin":
          "%s"
                ',
        self$`coin`
        )},
        if (!is.null(self$`depositAllEnable`)) {
        sprintf(
        '"depositAllEnable":
          %s
                ',
        tolower(self$`depositAllEnable`)
        )},
        if (!is.null(self$`free`)) {
        sprintf(
        '"free":
          "%s"
                ',
        self$`free`
        )},
        if (!is.null(self$`freeze`)) {
        sprintf(
        '"freeze":
          "%s"
                ',
        self$`freeze`
        )},
        if (!is.null(self$`ipoable`)) {
        sprintf(
        '"ipoable":
          "%s"
                ',
        self$`ipoable`
        )},
        if (!is.null(self$`ipoing`)) {
        sprintf(
        '"ipoing":
          "%s"
                ',
        self$`ipoing`
        )},
        if (!is.null(self$`isLegalMoney`)) {
        sprintf(
        '"isLegalMoney":
          %s
                ',
        tolower(self$`isLegalMoney`)
        )},
        if (!is.null(self$`locked`)) {
        sprintf(
        '"locked":
          "%s"
                ',
        self$`locked`
        )},
        if (!is.null(self$`name`)) {
        sprintf(
        '"name":
          "%s"
                ',
        self$`name`
        )},
        if (!is.null(self$`networkList`)) {
        sprintf(
        '"networkList":
        [%s]
',
        paste(sapply(self$`networkList`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox=TRUE, digits = NA)), collapse=",")
        )},
        if (!is.null(self$`storage`)) {
        sprintf(
        '"storage":
          "%s"
                ',
        self$`storage`
        )},
        if (!is.null(self$`trading`)) {
        sprintf(
        '"trading":
          %s
                ',
        tolower(self$`trading`)
        )},
        if (!is.null(self$`withdrawAllEnable`)) {
        sprintf(
        '"withdrawAllEnable":
          %s
                ',
        tolower(self$`withdrawAllEnable`)
        )},
        if (!is.null(self$`withdrawing`)) {
        sprintf(
        '"withdrawing":
          "%s"
                ',
        self$`withdrawing`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(InlineResponse20034Json) {
      InlineResponse20034Object <- jsonlite::fromJSON(InlineResponse20034Json)
      self$`coin` <- InlineResponse20034Object$`coin`
      self$`depositAllEnable` <- InlineResponse20034Object$`depositAllEnable`
      self$`free` <- InlineResponse20034Object$`free`
      self$`freeze` <- InlineResponse20034Object$`freeze`
      self$`ipoable` <- InlineResponse20034Object$`ipoable`
      self$`ipoing` <- InlineResponse20034Object$`ipoing`
      self$`isLegalMoney` <- InlineResponse20034Object$`isLegalMoney`
      self$`locked` <- InlineResponse20034Object$`locked`
      self$`name` <- InlineResponse20034Object$`name`
      self$`networkList` <- ApiClient$new()$deserializeObj(InlineResponse20034Object$`networkList`, "array[SapiV1CapitalConfigGetallNetworkList]", loadNamespace("binanceRapi"))
      self$`storage` <- InlineResponse20034Object$`storage`
      self$`trading` <- InlineResponse20034Object$`trading`
      self$`withdrawAllEnable` <- InlineResponse20034Object$`withdrawAllEnable`
      self$`withdrawing` <- InlineResponse20034Object$`withdrawing`
      self
    }
  )
)
grahamjwhite/binanceRapi documentation built on Nov. 22, 2022, 9:37 p.m.