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

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