# 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 InlineResponse200103Data
#'
#' @description InlineResponse200103Data Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field workerName character
#'
#' @field type character
#'
#' @field hashrateDatas list( \link{InlineResponse200103HashrateDatas} )
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
InlineResponse200103Data <- R6::R6Class(
'InlineResponse200103Data',
public = list(
`workerName` = NULL,
`type` = NULL,
`hashrateDatas` = NULL,
initialize = function(
`workerName`, `type`, `hashrateDatas`, ...
) {
local.optional.var <- list(...)
if (!missing(`workerName`)) {
stopifnot(is.character(`workerName`), length(`workerName`) == 1)
self$`workerName` <- `workerName`
}
if (!missing(`type`)) {
stopifnot(is.character(`type`), length(`type`) == 1)
self$`type` <- `type`
}
if (!missing(`hashrateDatas`)) {
stopifnot(is.vector(`hashrateDatas`), length(`hashrateDatas`) != 0)
sapply(`hashrateDatas`, function(x) stopifnot(R6::is.R6(x)))
self$`hashrateDatas` <- `hashrateDatas`
}
},
toJSON = function() {
InlineResponse200103DataObject <- list()
if (!is.null(self$`workerName`)) {
InlineResponse200103DataObject[['workerName']] <-
self$`workerName`
}
if (!is.null(self$`type`)) {
InlineResponse200103DataObject[['type']] <-
self$`type`
}
if (!is.null(self$`hashrateDatas`)) {
InlineResponse200103DataObject[['hashrateDatas']] <-
lapply(self$`hashrateDatas`, function(x) x$toJSON())
}
InlineResponse200103DataObject
},
fromJSON = function(InlineResponse200103DataJson) {
InlineResponse200103DataObject <- jsonlite::fromJSON(InlineResponse200103DataJson)
if (!is.null(InlineResponse200103DataObject$`workerName`)) {
self$`workerName` <- InlineResponse200103DataObject$`workerName`
}
if (!is.null(InlineResponse200103DataObject$`type`)) {
self$`type` <- InlineResponse200103DataObject$`type`
}
if (!is.null(InlineResponse200103DataObject$`hashrateDatas`)) {
self$`hashrateDatas` <- ApiClient$new()$deserializeObj(InlineResponse200103DataObject$`hashrateDatas`, "array[InlineResponse200103HashrateDatas]", loadNamespace("binanceRapi"))
}
self
},
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`workerName`)) {
sprintf(
'"workerName":
"%s"
',
self$`workerName`
)},
if (!is.null(self$`type`)) {
sprintf(
'"type":
"%s"
',
self$`type`
)},
if (!is.null(self$`hashrateDatas`)) {
sprintf(
'"hashrateDatas":
[%s]
',
paste(sapply(self$`hashrateDatas`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox=TRUE, digits = NA)), collapse=",")
)}
)
jsoncontent <- paste(jsoncontent, collapse = ",")
paste('{', jsoncontent, '}', sep = "")
},
fromJSONString = function(InlineResponse200103DataJson) {
InlineResponse200103DataObject <- jsonlite::fromJSON(InlineResponse200103DataJson)
self$`workerName` <- InlineResponse200103DataObject$`workerName`
self$`type` <- InlineResponse200103DataObject$`type`
self$`hashrateDatas` <- ApiClient$new()$deserializeObj(InlineResponse200103DataObject$`hashrateDatas`, "array[InlineResponse200103HashrateDatas]", loadNamespace("binanceRapi"))
self
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.