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

      InlineResponse200110Object
    },
    fromJSON = function(InlineResponse200110Json) {
      InlineResponse200110Object <- jsonlite::fromJSON(InlineResponse200110Json)
      if (!is.null(InlineResponse200110Object$`code`)) {
        self$`code` <- InlineResponse200110Object$`code`
      }
      if (!is.null(InlineResponse200110Object$`msg`)) {
        self$`msg` <- InlineResponse200110Object$`msg`
      }
      if (!is.null(InlineResponse200110Object$`data`)) {
        self$`data` <- InlineResponse200110Object$`data`
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`code`)) {
        sprintf(
        '"code":
          %d
                ',
        self$`code`
        )},
        if (!is.null(self$`msg`)) {
        sprintf(
        '"msg":
          "%s"
                ',
        self$`msg`
        )},
        if (!is.null(self$`data`)) {
        sprintf(
        '"data":
          %s
                ',
        tolower(self$`data`)
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(InlineResponse200110Json) {
      InlineResponse200110Object <- jsonlite::fromJSON(InlineResponse200110Json)
      self$`code` <- InlineResponse200110Object$`code`
      self$`msg` <- InlineResponse200110Object$`msg`
      self$`data` <- InlineResponse200110Object$`data`
      self
    }
  )
)
grahamjwhite/binanceRapi documentation built on Nov. 22, 2022, 9:37 p.m.