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

      InlineResponse20095Object
    },
    fromJSON = function(InlineResponse20095Json) {
      InlineResponse20095Object <- jsonlite::fromJSON(InlineResponse20095Json)
      if (!is.null(InlineResponse20095Object$`projectId`)) {
        self$`projectId` <- InlineResponse20095Object$`projectId`
      }
      if (!is.null(InlineResponse20095Object$`detail`)) {
        detailObject <- SapiV1StakingProductListDetail$new()
        detailObject$fromJSON(jsonlite::toJSON(InlineResponse20095Object$detail, auto_unbox = TRUE, digits = NA))
        self$`detail` <- detailObject
      }
      if (!is.null(InlineResponse20095Object$`quota`)) {
        quotaObject <- SapiV1StakingProductListQuota$new()
        quotaObject$fromJSON(jsonlite::toJSON(InlineResponse20095Object$quota, auto_unbox = TRUE, digits = NA))
        self$`quota` <- quotaObject
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`projectId`)) {
        sprintf(
        '"projectId":
          "%s"
                ',
        self$`projectId`
        )},
        if (!is.null(self$`detail`)) {
        sprintf(
        '"detail":
        %s
        ',
        jsonlite::toJSON(self$`detail`$toJSON(), auto_unbox=TRUE, digits = NA)
        )},
        if (!is.null(self$`quota`)) {
        sprintf(
        '"quota":
        %s
        ',
        jsonlite::toJSON(self$`quota`$toJSON(), auto_unbox=TRUE, digits = NA)
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(InlineResponse20095Json) {
      InlineResponse20095Object <- jsonlite::fromJSON(InlineResponse20095Json)
      self$`projectId` <- InlineResponse20095Object$`projectId`
      self$`detail` <- SapiV1StakingProductListDetail$new()$fromJSON(jsonlite::toJSON(InlineResponse20095Object$detail, auto_unbox = TRUE, digits = NA))
      self$`quota` <- SapiV1StakingProductListQuota$new()$fromJSON(jsonlite::toJSON(InlineResponse20095Object$quota, auto_unbox = TRUE, digits = NA))
      self
    }
  )
)
grahamjwhite/binanceRapi documentation built on Nov. 22, 2022, 9:37 p.m.