R/inline_response20070.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 InlineResponse20070
#'
#' @description InlineResponse20070 Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field tranId  integer 
#'
#' @field fromEmail  character 
#'
#' @field toEmail  character 
#'
#' @field asset  character 
#'
#' @field amount  character 
#'
#' @field fromAccountType  character 
#'
#' @field toAccountType  character 
#'
#' @field status  character 
#'
#' @field createTimeStamp  integer 
#'
#' @field clientTranId  character 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
InlineResponse20070 <- R6::R6Class(
  'InlineResponse20070',
  public = list(
    `tranId` = NULL,
    `fromEmail` = NULL,
    `toEmail` = NULL,
    `asset` = NULL,
    `amount` = NULL,
    `fromAccountType` = NULL,
    `toAccountType` = NULL,
    `status` = NULL,
    `createTimeStamp` = NULL,
    `clientTranId` = NULL,
    initialize = function(
        `tranId`, `fromEmail`, `toEmail`, `asset`, `amount`, `fromAccountType`, `toAccountType`, `status`, `createTimeStamp`, `clientTranId`, ...
    ) {
      local.optional.var <- list(...)
      if (!missing(`tranId`)) {
        stopifnot(is.numeric(`tranId`), length(`tranId`) == 1)
        self$`tranId` <- `tranId`
      }
      if (!missing(`fromEmail`)) {
        stopifnot(is.character(`fromEmail`), length(`fromEmail`) == 1)
        self$`fromEmail` <- `fromEmail`
      }
      if (!missing(`toEmail`)) {
        stopifnot(is.character(`toEmail`), length(`toEmail`) == 1)
        self$`toEmail` <- `toEmail`
      }
      if (!missing(`asset`)) {
        stopifnot(is.character(`asset`), length(`asset`) == 1)
        self$`asset` <- `asset`
      }
      if (!missing(`amount`)) {
        stopifnot(is.character(`amount`), length(`amount`) == 1)
        self$`amount` <- `amount`
      }
      if (!missing(`fromAccountType`)) {
        stopifnot(is.character(`fromAccountType`), length(`fromAccountType`) == 1)
        self$`fromAccountType` <- `fromAccountType`
      }
      if (!missing(`toAccountType`)) {
        stopifnot(is.character(`toAccountType`), length(`toAccountType`) == 1)
        self$`toAccountType` <- `toAccountType`
      }
      if (!missing(`status`)) {
        stopifnot(is.character(`status`), length(`status`) == 1)
        self$`status` <- `status`
      }
      if (!missing(`createTimeStamp`)) {
        stopifnot(is.numeric(`createTimeStamp`), length(`createTimeStamp`) == 1)
        self$`createTimeStamp` <- `createTimeStamp`
      }
      if (!missing(`clientTranId`)) {
        stopifnot(is.character(`clientTranId`), length(`clientTranId`) == 1)
        self$`clientTranId` <- `clientTranId`
      }
    },
    toJSON = function() {
      InlineResponse20070Object <- list()
      if (!is.null(self$`tranId`)) {
        InlineResponse20070Object[['tranId']] <-
          self$`tranId`
      }
      if (!is.null(self$`fromEmail`)) {
        InlineResponse20070Object[['fromEmail']] <-
          self$`fromEmail`
      }
      if (!is.null(self$`toEmail`)) {
        InlineResponse20070Object[['toEmail']] <-
          self$`toEmail`
      }
      if (!is.null(self$`asset`)) {
        InlineResponse20070Object[['asset']] <-
          self$`asset`
      }
      if (!is.null(self$`amount`)) {
        InlineResponse20070Object[['amount']] <-
          self$`amount`
      }
      if (!is.null(self$`fromAccountType`)) {
        InlineResponse20070Object[['fromAccountType']] <-
          self$`fromAccountType`
      }
      if (!is.null(self$`toAccountType`)) {
        InlineResponse20070Object[['toAccountType']] <-
          self$`toAccountType`
      }
      if (!is.null(self$`status`)) {
        InlineResponse20070Object[['status']] <-
          self$`status`
      }
      if (!is.null(self$`createTimeStamp`)) {
        InlineResponse20070Object[['createTimeStamp']] <-
          self$`createTimeStamp`
      }
      if (!is.null(self$`clientTranId`)) {
        InlineResponse20070Object[['clientTranId']] <-
          self$`clientTranId`
      }

      InlineResponse20070Object
    },
    fromJSON = function(InlineResponse20070Json) {
      InlineResponse20070Object <- jsonlite::fromJSON(InlineResponse20070Json)
      if (!is.null(InlineResponse20070Object$`tranId`)) {
        self$`tranId` <- InlineResponse20070Object$`tranId`
      }
      if (!is.null(InlineResponse20070Object$`fromEmail`)) {
        self$`fromEmail` <- InlineResponse20070Object$`fromEmail`
      }
      if (!is.null(InlineResponse20070Object$`toEmail`)) {
        self$`toEmail` <- InlineResponse20070Object$`toEmail`
      }
      if (!is.null(InlineResponse20070Object$`asset`)) {
        self$`asset` <- InlineResponse20070Object$`asset`
      }
      if (!is.null(InlineResponse20070Object$`amount`)) {
        self$`amount` <- InlineResponse20070Object$`amount`
      }
      if (!is.null(InlineResponse20070Object$`fromAccountType`)) {
        self$`fromAccountType` <- InlineResponse20070Object$`fromAccountType`
      }
      if (!is.null(InlineResponse20070Object$`toAccountType`)) {
        self$`toAccountType` <- InlineResponse20070Object$`toAccountType`
      }
      if (!is.null(InlineResponse20070Object$`status`)) {
        self$`status` <- InlineResponse20070Object$`status`
      }
      if (!is.null(InlineResponse20070Object$`createTimeStamp`)) {
        self$`createTimeStamp` <- InlineResponse20070Object$`createTimeStamp`
      }
      if (!is.null(InlineResponse20070Object$`clientTranId`)) {
        self$`clientTranId` <- InlineResponse20070Object$`clientTranId`
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`tranId`)) {
        sprintf(
        '"tranId":
          %d
                ',
        self$`tranId`
        )},
        if (!is.null(self$`fromEmail`)) {
        sprintf(
        '"fromEmail":
          "%s"
                ',
        self$`fromEmail`
        )},
        if (!is.null(self$`toEmail`)) {
        sprintf(
        '"toEmail":
          "%s"
                ',
        self$`toEmail`
        )},
        if (!is.null(self$`asset`)) {
        sprintf(
        '"asset":
          "%s"
                ',
        self$`asset`
        )},
        if (!is.null(self$`amount`)) {
        sprintf(
        '"amount":
          "%s"
                ',
        self$`amount`
        )},
        if (!is.null(self$`fromAccountType`)) {
        sprintf(
        '"fromAccountType":
          "%s"
                ',
        self$`fromAccountType`
        )},
        if (!is.null(self$`toAccountType`)) {
        sprintf(
        '"toAccountType":
          "%s"
                ',
        self$`toAccountType`
        )},
        if (!is.null(self$`status`)) {
        sprintf(
        '"status":
          "%s"
                ',
        self$`status`
        )},
        if (!is.null(self$`createTimeStamp`)) {
        sprintf(
        '"createTimeStamp":
          %d
                ',
        self$`createTimeStamp`
        )},
        if (!is.null(self$`clientTranId`)) {
        sprintf(
        '"clientTranId":
          "%s"
                ',
        self$`clientTranId`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(InlineResponse20070Json) {
      InlineResponse20070Object <- jsonlite::fromJSON(InlineResponse20070Json)
      self$`tranId` <- InlineResponse20070Object$`tranId`
      self$`fromEmail` <- InlineResponse20070Object$`fromEmail`
      self$`toEmail` <- InlineResponse20070Object$`toEmail`
      self$`asset` <- InlineResponse20070Object$`asset`
      self$`amount` <- InlineResponse20070Object$`amount`
      self$`fromAccountType` <- InlineResponse20070Object$`fromAccountType`
      self$`toAccountType` <- InlineResponse20070Object$`toAccountType`
      self$`status` <- InlineResponse20070Object$`status`
      self$`createTimeStamp` <- InlineResponse20070Object$`createTimeStamp`
      self$`clientTranId` <- InlineResponse20070Object$`clientTranId`
      self
    }
  )
)
grahamjwhite/binanceRapi documentation built on Nov. 22, 2022, 9:37 p.m.