R/inline_response20042.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 InlineResponse20042
#'
#' @description InlineResponse20042 Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field details  list( \link{InlineResponse20042Details} ) 
#'
#' @field totalTransferBtc  character 
#'
#' @field totalTransferBNB  character 
#'
#' @field dribbletPercentage  character 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
InlineResponse20042 <- R6::R6Class(
  'InlineResponse20042',
  public = list(
    `details` = NULL,
    `totalTransferBtc` = NULL,
    `totalTransferBNB` = NULL,
    `dribbletPercentage` = NULL,
    initialize = function(
        `details`, `totalTransferBtc`, `totalTransferBNB`, `dribbletPercentage`, ...
    ) {
      local.optional.var <- list(...)
      if (!missing(`details`)) {
        stopifnot(is.vector(`details`), length(`details`) != 0)
        sapply(`details`, function(x) stopifnot(R6::is.R6(x)))
        self$`details` <- `details`
      }
      if (!missing(`totalTransferBtc`)) {
        stopifnot(is.character(`totalTransferBtc`), length(`totalTransferBtc`) == 1)
        self$`totalTransferBtc` <- `totalTransferBtc`
      }
      if (!missing(`totalTransferBNB`)) {
        stopifnot(is.character(`totalTransferBNB`), length(`totalTransferBNB`) == 1)
        self$`totalTransferBNB` <- `totalTransferBNB`
      }
      if (!missing(`dribbletPercentage`)) {
        stopifnot(is.character(`dribbletPercentage`), length(`dribbletPercentage`) == 1)
        self$`dribbletPercentage` <- `dribbletPercentage`
      }
    },
    toJSON = function() {
      InlineResponse20042Object <- list()
      if (!is.null(self$`details`)) {
        InlineResponse20042Object[['details']] <-
          lapply(self$`details`, function(x) x$toJSON())
      }
      if (!is.null(self$`totalTransferBtc`)) {
        InlineResponse20042Object[['totalTransferBtc']] <-
          self$`totalTransferBtc`
      }
      if (!is.null(self$`totalTransferBNB`)) {
        InlineResponse20042Object[['totalTransferBNB']] <-
          self$`totalTransferBNB`
      }
      if (!is.null(self$`dribbletPercentage`)) {
        InlineResponse20042Object[['dribbletPercentage']] <-
          self$`dribbletPercentage`
      }

      InlineResponse20042Object
    },
    fromJSON = function(InlineResponse20042Json) {
      InlineResponse20042Object <- jsonlite::fromJSON(InlineResponse20042Json)
      if (!is.null(InlineResponse20042Object$`details`)) {
        self$`details` <- ApiClient$new()$deserializeObj(InlineResponse20042Object$`details`, "array[InlineResponse20042Details]", loadNamespace("binanceRapi"))
      }
      if (!is.null(InlineResponse20042Object$`totalTransferBtc`)) {
        self$`totalTransferBtc` <- InlineResponse20042Object$`totalTransferBtc`
      }
      if (!is.null(InlineResponse20042Object$`totalTransferBNB`)) {
        self$`totalTransferBNB` <- InlineResponse20042Object$`totalTransferBNB`
      }
      if (!is.null(InlineResponse20042Object$`dribbletPercentage`)) {
        self$`dribbletPercentage` <- InlineResponse20042Object$`dribbletPercentage`
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`details`)) {
        sprintf(
        '"details":
        [%s]
',
        paste(sapply(self$`details`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox=TRUE, digits = NA)), collapse=",")
        )},
        if (!is.null(self$`totalTransferBtc`)) {
        sprintf(
        '"totalTransferBtc":
          "%s"
                ',
        self$`totalTransferBtc`
        )},
        if (!is.null(self$`totalTransferBNB`)) {
        sprintf(
        '"totalTransferBNB":
          "%s"
                ',
        self$`totalTransferBNB`
        )},
        if (!is.null(self$`dribbletPercentage`)) {
        sprintf(
        '"dribbletPercentage":
          "%s"
                ',
        self$`dribbletPercentage`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(InlineResponse20042Json) {
      InlineResponse20042Object <- jsonlite::fromJSON(InlineResponse20042Json)
      self$`details` <- ApiClient$new()$deserializeObj(InlineResponse20042Object$`details`, "array[InlineResponse20042Details]", loadNamespace("binanceRapi"))
      self$`totalTransferBtc` <- InlineResponse20042Object$`totalTransferBtc`
      self$`totalTransferBNB` <- InlineResponse20042Object$`totalTransferBNB`
      self$`dribbletPercentage` <- InlineResponse20042Object$`dribbletPercentage`
      self
    }
  )
)
grahamjwhite/binanceRapi documentation built on Nov. 22, 2022, 9:37 p.m.