R/inline_response20043_transfer_result.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 InlineResponse20043TransferResult
#'
#' @description InlineResponse20043TransferResult Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field amount  character 
#'
#' @field fromAsset  character 
#'
#' @field operateTime  integer 
#'
#' @field serviceChargeAmount  character 
#'
#' @field tranId  integer 
#'
#' @field transferedAmount  character 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
InlineResponse20043TransferResult <- R6::R6Class(
  'InlineResponse20043TransferResult',
  public = list(
    `amount` = NULL,
    `fromAsset` = NULL,
    `operateTime` = NULL,
    `serviceChargeAmount` = NULL,
    `tranId` = NULL,
    `transferedAmount` = NULL,
    initialize = function(
        `amount`, `fromAsset`, `operateTime`, `serviceChargeAmount`, `tranId`, `transferedAmount`, ...
    ) {
      local.optional.var <- list(...)
      if (!missing(`amount`)) {
        stopifnot(is.character(`amount`), length(`amount`) == 1)
        self$`amount` <- `amount`
      }
      if (!missing(`fromAsset`)) {
        stopifnot(is.character(`fromAsset`), length(`fromAsset`) == 1)
        self$`fromAsset` <- `fromAsset`
      }
      if (!missing(`operateTime`)) {
        stopifnot(is.numeric(`operateTime`), length(`operateTime`) == 1)
        self$`operateTime` <- `operateTime`
      }
      if (!missing(`serviceChargeAmount`)) {
        stopifnot(is.character(`serviceChargeAmount`), length(`serviceChargeAmount`) == 1)
        self$`serviceChargeAmount` <- `serviceChargeAmount`
      }
      if (!missing(`tranId`)) {
        stopifnot(is.numeric(`tranId`), length(`tranId`) == 1)
        self$`tranId` <- `tranId`
      }
      if (!missing(`transferedAmount`)) {
        stopifnot(is.character(`transferedAmount`), length(`transferedAmount`) == 1)
        self$`transferedAmount` <- `transferedAmount`
      }
    },
    toJSON = function() {
      InlineResponse20043TransferResultObject <- list()
      if (!is.null(self$`amount`)) {
        InlineResponse20043TransferResultObject[['amount']] <-
          self$`amount`
      }
      if (!is.null(self$`fromAsset`)) {
        InlineResponse20043TransferResultObject[['fromAsset']] <-
          self$`fromAsset`
      }
      if (!is.null(self$`operateTime`)) {
        InlineResponse20043TransferResultObject[['operateTime']] <-
          self$`operateTime`
      }
      if (!is.null(self$`serviceChargeAmount`)) {
        InlineResponse20043TransferResultObject[['serviceChargeAmount']] <-
          self$`serviceChargeAmount`
      }
      if (!is.null(self$`tranId`)) {
        InlineResponse20043TransferResultObject[['tranId']] <-
          self$`tranId`
      }
      if (!is.null(self$`transferedAmount`)) {
        InlineResponse20043TransferResultObject[['transferedAmount']] <-
          self$`transferedAmount`
      }

      InlineResponse20043TransferResultObject
    },
    fromJSON = function(InlineResponse20043TransferResultJson) {
      InlineResponse20043TransferResultObject <- jsonlite::fromJSON(InlineResponse20043TransferResultJson)
      if (!is.null(InlineResponse20043TransferResultObject$`amount`)) {
        self$`amount` <- InlineResponse20043TransferResultObject$`amount`
      }
      if (!is.null(InlineResponse20043TransferResultObject$`fromAsset`)) {
        self$`fromAsset` <- InlineResponse20043TransferResultObject$`fromAsset`
      }
      if (!is.null(InlineResponse20043TransferResultObject$`operateTime`)) {
        self$`operateTime` <- InlineResponse20043TransferResultObject$`operateTime`
      }
      if (!is.null(InlineResponse20043TransferResultObject$`serviceChargeAmount`)) {
        self$`serviceChargeAmount` <- InlineResponse20043TransferResultObject$`serviceChargeAmount`
      }
      if (!is.null(InlineResponse20043TransferResultObject$`tranId`)) {
        self$`tranId` <- InlineResponse20043TransferResultObject$`tranId`
      }
      if (!is.null(InlineResponse20043TransferResultObject$`transferedAmount`)) {
        self$`transferedAmount` <- InlineResponse20043TransferResultObject$`transferedAmount`
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`amount`)) {
        sprintf(
        '"amount":
          "%s"
                ',
        self$`amount`
        )},
        if (!is.null(self$`fromAsset`)) {
        sprintf(
        '"fromAsset":
          "%s"
                ',
        self$`fromAsset`
        )},
        if (!is.null(self$`operateTime`)) {
        sprintf(
        '"operateTime":
          %d
                ',
        self$`operateTime`
        )},
        if (!is.null(self$`serviceChargeAmount`)) {
        sprintf(
        '"serviceChargeAmount":
          "%s"
                ',
        self$`serviceChargeAmount`
        )},
        if (!is.null(self$`tranId`)) {
        sprintf(
        '"tranId":
          %d
                ',
        self$`tranId`
        )},
        if (!is.null(self$`transferedAmount`)) {
        sprintf(
        '"transferedAmount":
          "%s"
                ',
        self$`transferedAmount`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(InlineResponse20043TransferResultJson) {
      InlineResponse20043TransferResultObject <- jsonlite::fromJSON(InlineResponse20043TransferResultJson)
      self$`amount` <- InlineResponse20043TransferResultObject$`amount`
      self$`fromAsset` <- InlineResponse20043TransferResultObject$`fromAsset`
      self$`operateTime` <- InlineResponse20043TransferResultObject$`operateTime`
      self$`serviceChargeAmount` <- InlineResponse20043TransferResultObject$`serviceChargeAmount`
      self$`tranId` <- InlineResponse20043TransferResultObject$`tranId`
      self$`transferedAmount` <- InlineResponse20043TransferResultObject$`transferedAmount`
      self
    }
  )
)
grahamjwhite/binanceRapi documentation built on Nov. 22, 2022, 9:37 p.m.