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

      InlineResponse200105DataAccountProfitsObject
    },
    fromJSON = function(InlineResponse200105DataAccountProfitsJson) {
      InlineResponse200105DataAccountProfitsObject <- jsonlite::fromJSON(InlineResponse200105DataAccountProfitsJson)
      if (!is.null(InlineResponse200105DataAccountProfitsObject$`time`)) {
        self$`time` <- InlineResponse200105DataAccountProfitsObject$`time`
      }
      if (!is.null(InlineResponse200105DataAccountProfitsObject$`type`)) {
        self$`type` <- InlineResponse200105DataAccountProfitsObject$`type`
      }
      if (!is.null(InlineResponse200105DataAccountProfitsObject$`hashTransfer`)) {
        self$`hashTransfer` <- InlineResponse200105DataAccountProfitsObject$`hashTransfer`
      }
      if (!is.null(InlineResponse200105DataAccountProfitsObject$`transferAmount`)) {
        self$`transferAmount` <- InlineResponse200105DataAccountProfitsObject$`transferAmount`
      }
      if (!is.null(InlineResponse200105DataAccountProfitsObject$`dayHashRate`)) {
        self$`dayHashRate` <- InlineResponse200105DataAccountProfitsObject$`dayHashRate`
      }
      if (!is.null(InlineResponse200105DataAccountProfitsObject$`profitAmount`)) {
        self$`profitAmount` <- InlineResponse200105DataAccountProfitsObject$`profitAmount`
      }
      if (!is.null(InlineResponse200105DataAccountProfitsObject$`coinName`)) {
        self$`coinName` <- InlineResponse200105DataAccountProfitsObject$`coinName`
      }
      if (!is.null(InlineResponse200105DataAccountProfitsObject$`status`)) {
        self$`status` <- InlineResponse200105DataAccountProfitsObject$`status`
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`time`)) {
        sprintf(
        '"time":
          %d
                ',
        self$`time`
        )},
        if (!is.null(self$`type`)) {
        sprintf(
        '"type":
          %d
                ',
        self$`type`
        )},
        if (!is.null(self$`hashTransfer`)) {
        sprintf(
        '"hashTransfer":
          %d
                ',
        self$`hashTransfer`
        )},
        if (!is.null(self$`transferAmount`)) {
        sprintf(
        '"transferAmount":
          %d
                ',
        self$`transferAmount`
        )},
        if (!is.null(self$`dayHashRate`)) {
        sprintf(
        '"dayHashRate":
          %d
                ',
        self$`dayHashRate`
        )},
        if (!is.null(self$`profitAmount`)) {
        sprintf(
        '"profitAmount":
          %d
                ',
        self$`profitAmount`
        )},
        if (!is.null(self$`coinName`)) {
        sprintf(
        '"coinName":
          "%s"
                ',
        self$`coinName`
        )},
        if (!is.null(self$`status`)) {
        sprintf(
        '"status":
          %d
                ',
        self$`status`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(InlineResponse200105DataAccountProfitsJson) {
      InlineResponse200105DataAccountProfitsObject <- jsonlite::fromJSON(InlineResponse200105DataAccountProfitsJson)
      self$`time` <- InlineResponse200105DataAccountProfitsObject$`time`
      self$`type` <- InlineResponse200105DataAccountProfitsObject$`type`
      self$`hashTransfer` <- InlineResponse200105DataAccountProfitsObject$`hashTransfer`
      self$`transferAmount` <- InlineResponse200105DataAccountProfitsObject$`transferAmount`
      self$`dayHashRate` <- InlineResponse200105DataAccountProfitsObject$`dayHashRate`
      self$`profitAmount` <- InlineResponse200105DataAccountProfitsObject$`profitAmount`
      self$`coinName` <- InlineResponse200105DataAccountProfitsObject$`coinName`
      self$`status` <- InlineResponse200105DataAccountProfitsObject$`status`
      self
    }
  )
)
grahamjwhite/binanceRapi documentation built on Nov. 22, 2022, 9:37 p.m.