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

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