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

      InlineResponse20042RowsObject
    },
    fromJSON = function(InlineResponse20042RowsJson) {
      InlineResponse20042RowsObject <- jsonlite::fromJSON(InlineResponse20042RowsJson)
      if (!is.null(InlineResponse20042RowsObject$`id`)) {
        self$`id` <- InlineResponse20042RowsObject$`id`
      }
      if (!is.null(InlineResponse20042RowsObject$`amount`)) {
        self$`amount` <- InlineResponse20042RowsObject$`amount`
      }
      if (!is.null(InlineResponse20042RowsObject$`asset`)) {
        self$`asset` <- InlineResponse20042RowsObject$`asset`
      }
      if (!is.null(InlineResponse20042RowsObject$`divTime`)) {
        self$`divTime` <- InlineResponse20042RowsObject$`divTime`
      }
      if (!is.null(InlineResponse20042RowsObject$`enInfo`)) {
        self$`enInfo` <- InlineResponse20042RowsObject$`enInfo`
      }
      if (!is.null(InlineResponse20042RowsObject$`tranId`)) {
        self$`tranId` <- InlineResponse20042RowsObject$`tranId`
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`id`)) {
        sprintf(
        '"id":
          %d
                ',
        self$`id`
        )},
        if (!is.null(self$`amount`)) {
        sprintf(
        '"amount":
          "%s"
                ',
        self$`amount`
        )},
        if (!is.null(self$`asset`)) {
        sprintf(
        '"asset":
          "%s"
                ',
        self$`asset`
        )},
        if (!is.null(self$`divTime`)) {
        sprintf(
        '"divTime":
          %d
                ',
        self$`divTime`
        )},
        if (!is.null(self$`enInfo`)) {
        sprintf(
        '"enInfo":
          "%s"
                ',
        self$`enInfo`
        )},
        if (!is.null(self$`tranId`)) {
        sprintf(
        '"tranId":
          %d
                ',
        self$`tranId`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(InlineResponse20042RowsJson) {
      InlineResponse20042RowsObject <- jsonlite::fromJSON(InlineResponse20042RowsJson)
      self$`id` <- InlineResponse20042RowsObject$`id`
      self$`amount` <- InlineResponse20042RowsObject$`amount`
      self$`asset` <- InlineResponse20042RowsObject$`asset`
      self$`divTime` <- InlineResponse20042RowsObject$`divTime`
      self$`enInfo` <- InlineResponse20042RowsObject$`enInfo`
      self$`tranId` <- InlineResponse20042RowsObject$`tranId`
      self
    }
  )
)
grahamjwhite/binanceRapi documentation built on Nov. 22, 2022, 9:37 p.m.