R/inline_response20060.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 InlineResponse20060
#'
#' @description InlineResponse20060 Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field email  character 
#'
#' @field isSubUserEnabled  character 
#'
#' @field isUserActive  character 
#'
#' @field insertTime  integer 
#'
#' @field isMarginEnabled  character 
#'
#' @field isFutureEnabled  character 
#'
#' @field mobile  integer 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
InlineResponse20060 <- R6::R6Class(
  'InlineResponse20060',
  public = list(
    `email` = NULL,
    `isSubUserEnabled` = NULL,
    `isUserActive` = NULL,
    `insertTime` = NULL,
    `isMarginEnabled` = NULL,
    `isFutureEnabled` = NULL,
    `mobile` = NULL,
    initialize = function(
        `email`, `isSubUserEnabled`, `isUserActive`, `insertTime`, `isMarginEnabled`, `isFutureEnabled`, `mobile`, ...
    ) {
      local.optional.var <- list(...)
      if (!missing(`email`)) {
        stopifnot(is.character(`email`), length(`email`) == 1)
        self$`email` <- `email`
      }
      if (!missing(`isSubUserEnabled`)) {
        stopifnot(is.logical(`isSubUserEnabled`), length(`isSubUserEnabled`) == 1)
        self$`isSubUserEnabled` <- `isSubUserEnabled`
      }
      if (!missing(`isUserActive`)) {
        stopifnot(is.logical(`isUserActive`), length(`isUserActive`) == 1)
        self$`isUserActive` <- `isUserActive`
      }
      if (!missing(`insertTime`)) {
        stopifnot(is.numeric(`insertTime`), length(`insertTime`) == 1)
        self$`insertTime` <- `insertTime`
      }
      if (!missing(`isMarginEnabled`)) {
        stopifnot(is.logical(`isMarginEnabled`), length(`isMarginEnabled`) == 1)
        self$`isMarginEnabled` <- `isMarginEnabled`
      }
      if (!missing(`isFutureEnabled`)) {
        stopifnot(is.logical(`isFutureEnabled`), length(`isFutureEnabled`) == 1)
        self$`isFutureEnabled` <- `isFutureEnabled`
      }
      if (!missing(`mobile`)) {
        stopifnot(is.numeric(`mobile`), length(`mobile`) == 1)
        self$`mobile` <- `mobile`
      }
    },
    toJSON = function() {
      InlineResponse20060Object <- list()
      if (!is.null(self$`email`)) {
        InlineResponse20060Object[['email']] <-
          self$`email`
      }
      if (!is.null(self$`isSubUserEnabled`)) {
        InlineResponse20060Object[['isSubUserEnabled']] <-
          self$`isSubUserEnabled`
      }
      if (!is.null(self$`isUserActive`)) {
        InlineResponse20060Object[['isUserActive']] <-
          self$`isUserActive`
      }
      if (!is.null(self$`insertTime`)) {
        InlineResponse20060Object[['insertTime']] <-
          self$`insertTime`
      }
      if (!is.null(self$`isMarginEnabled`)) {
        InlineResponse20060Object[['isMarginEnabled']] <-
          self$`isMarginEnabled`
      }
      if (!is.null(self$`isFutureEnabled`)) {
        InlineResponse20060Object[['isFutureEnabled']] <-
          self$`isFutureEnabled`
      }
      if (!is.null(self$`mobile`)) {
        InlineResponse20060Object[['mobile']] <-
          self$`mobile`
      }

      InlineResponse20060Object
    },
    fromJSON = function(InlineResponse20060Json) {
      InlineResponse20060Object <- jsonlite::fromJSON(InlineResponse20060Json)
      if (!is.null(InlineResponse20060Object$`email`)) {
        self$`email` <- InlineResponse20060Object$`email`
      }
      if (!is.null(InlineResponse20060Object$`isSubUserEnabled`)) {
        self$`isSubUserEnabled` <- InlineResponse20060Object$`isSubUserEnabled`
      }
      if (!is.null(InlineResponse20060Object$`isUserActive`)) {
        self$`isUserActive` <- InlineResponse20060Object$`isUserActive`
      }
      if (!is.null(InlineResponse20060Object$`insertTime`)) {
        self$`insertTime` <- InlineResponse20060Object$`insertTime`
      }
      if (!is.null(InlineResponse20060Object$`isMarginEnabled`)) {
        self$`isMarginEnabled` <- InlineResponse20060Object$`isMarginEnabled`
      }
      if (!is.null(InlineResponse20060Object$`isFutureEnabled`)) {
        self$`isFutureEnabled` <- InlineResponse20060Object$`isFutureEnabled`
      }
      if (!is.null(InlineResponse20060Object$`mobile`)) {
        self$`mobile` <- InlineResponse20060Object$`mobile`
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`email`)) {
        sprintf(
        '"email":
          "%s"
                ',
        self$`email`
        )},
        if (!is.null(self$`isSubUserEnabled`)) {
        sprintf(
        '"isSubUserEnabled":
          %s
                ',
        tolower(self$`isSubUserEnabled`)
        )},
        if (!is.null(self$`isUserActive`)) {
        sprintf(
        '"isUserActive":
          %s
                ',
        tolower(self$`isUserActive`)
        )},
        if (!is.null(self$`insertTime`)) {
        sprintf(
        '"insertTime":
          %d
                ',
        self$`insertTime`
        )},
        if (!is.null(self$`isMarginEnabled`)) {
        sprintf(
        '"isMarginEnabled":
          %s
                ',
        tolower(self$`isMarginEnabled`)
        )},
        if (!is.null(self$`isFutureEnabled`)) {
        sprintf(
        '"isFutureEnabled":
          %s
                ',
        tolower(self$`isFutureEnabled`)
        )},
        if (!is.null(self$`mobile`)) {
        sprintf(
        '"mobile":
          %d
                ',
        self$`mobile`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(InlineResponse20060Json) {
      InlineResponse20060Object <- jsonlite::fromJSON(InlineResponse20060Json)
      self$`email` <- InlineResponse20060Object$`email`
      self$`isSubUserEnabled` <- InlineResponse20060Object$`isSubUserEnabled`
      self$`isUserActive` <- InlineResponse20060Object$`isUserActive`
      self$`insertTime` <- InlineResponse20060Object$`insertTime`
      self$`isMarginEnabled` <- InlineResponse20060Object$`isMarginEnabled`
      self$`isFutureEnabled` <- InlineResponse20060Object$`isFutureEnabled`
      self$`mobile` <- InlineResponse20060Object$`mobile`
      self
    }
  )
)
grahamjwhite/binanceRapi documentation built on Nov. 22, 2022, 9:37 p.m.