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

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