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

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