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

      InlineResponse20053Object
    },
    fromJSON = function(InlineResponse20053Json) {
      InlineResponse20053Object <- jsonlite::fromJSON(InlineResponse20053Json)
      if (!is.null(InlineResponse20053Object$`from`)) {
        self$`from` <- InlineResponse20053Object$`from`
      }
      if (!is.null(InlineResponse20053Object$`to`)) {
        self$`to` <- InlineResponse20053Object$`to`
      }
      if (!is.null(InlineResponse20053Object$`asset`)) {
        self$`asset` <- InlineResponse20053Object$`asset`
      }
      if (!is.null(InlineResponse20053Object$`qty`)) {
        self$`qty` <- InlineResponse20053Object$`qty`
      }
      if (!is.null(InlineResponse20053Object$`status`)) {
        self$`status` <- InlineResponse20053Object$`status`
      }
      if (!is.null(InlineResponse20053Object$`tranId`)) {
        self$`tranId` <- InlineResponse20053Object$`tranId`
      }
      if (!is.null(InlineResponse20053Object$`time`)) {
        self$`time` <- InlineResponse20053Object$`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$`status`)) {
        sprintf(
        '"status":
          "%s"
                ',
        self$`status`
        )},
        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(InlineResponse20053Json) {
      InlineResponse20053Object <- jsonlite::fromJSON(InlineResponse20053Json)
      self$`from` <- InlineResponse20053Object$`from`
      self$`to` <- InlineResponse20053Object$`to`
      self$`asset` <- InlineResponse20053Object$`asset`
      self$`qty` <- InlineResponse20053Object$`qty`
      self$`status` <- InlineResponse20053Object$`status`
      self$`tranId` <- InlineResponse20053Object$`tranId`
      self$`time` <- InlineResponse20053Object$`time`
      self
    }
  )
)
grahamjwhite/binanceRapi documentation built on Nov. 22, 2022, 9:37 p.m.