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

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