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

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