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

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