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

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