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

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