R/inline_response200129.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 InlineResponse200129
#'
#' @description InlineResponse200129 Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field totalUnclaimedRewards  \link{InlineResponse200129TotalUnclaimedRewards} 
#'
#' @field details  \link{InlineResponse200129Details} 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
InlineResponse200129 <- R6::R6Class(
  'InlineResponse200129',
  public = list(
    `totalUnclaimedRewards` = NULL,
    `details` = NULL,
    initialize = function(
        `totalUnclaimedRewards`, `details`, ...
    ) {
      local.optional.var <- list(...)
      if (!missing(`totalUnclaimedRewards`)) {
        stopifnot(R6::is.R6(`totalUnclaimedRewards`))
        self$`totalUnclaimedRewards` <- `totalUnclaimedRewards`
      }
      if (!missing(`details`)) {
        stopifnot(R6::is.R6(`details`))
        self$`details` <- `details`
      }
    },
    toJSON = function() {
      InlineResponse200129Object <- list()
      if (!is.null(self$`totalUnclaimedRewards`)) {
        InlineResponse200129Object[['totalUnclaimedRewards']] <-
          self$`totalUnclaimedRewards`$toJSON()
      }
      if (!is.null(self$`details`)) {
        InlineResponse200129Object[['details']] <-
          self$`details`$toJSON()
      }

      InlineResponse200129Object
    },
    fromJSON = function(InlineResponse200129Json) {
      InlineResponse200129Object <- jsonlite::fromJSON(InlineResponse200129Json)
      if (!is.null(InlineResponse200129Object$`totalUnclaimedRewards`)) {
        totalUnclaimedRewardsObject <- InlineResponse200129TotalUnclaimedRewards$new()
        totalUnclaimedRewardsObject$fromJSON(jsonlite::toJSON(InlineResponse200129Object$totalUnclaimedRewards, auto_unbox = TRUE, digits = NA))
        self$`totalUnclaimedRewards` <- totalUnclaimedRewardsObject
      }
      if (!is.null(InlineResponse200129Object$`details`)) {
        detailsObject <- InlineResponse200129Details$new()
        detailsObject$fromJSON(jsonlite::toJSON(InlineResponse200129Object$details, auto_unbox = TRUE, digits = NA))
        self$`details` <- detailsObject
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`totalUnclaimedRewards`)) {
        sprintf(
        '"totalUnclaimedRewards":
        %s
        ',
        jsonlite::toJSON(self$`totalUnclaimedRewards`$toJSON(), auto_unbox=TRUE, digits = NA)
        )},
        if (!is.null(self$`details`)) {
        sprintf(
        '"details":
        %s
        ',
        jsonlite::toJSON(self$`details`$toJSON(), auto_unbox=TRUE, digits = NA)
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(InlineResponse200129Json) {
      InlineResponse200129Object <- jsonlite::fromJSON(InlineResponse200129Json)
      self$`totalUnclaimedRewards` <- InlineResponse200129TotalUnclaimedRewards$new()$fromJSON(jsonlite::toJSON(InlineResponse200129Object$totalUnclaimedRewards, auto_unbox = TRUE, digits = NA))
      self$`details` <- InlineResponse200129Details$new()$fromJSON(jsonlite::toJSON(InlineResponse200129Object$details, auto_unbox = TRUE, digits = NA))
      self
    }
  )
)
grahamjwhite/binanceRapi documentation built on Nov. 22, 2022, 9:37 p.m.