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

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