R/inline_response20098.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 InlineResponse20098
#'
#' @description InlineResponse20098 Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field positionId  character 
#'
#' @field projectId  character 
#'
#' @field asset  character 
#'
#' @field amount  character 
#'
#' @field purchaseTime  character 
#'
#' @field duration  character 
#'
#' @field accrualDays  character 
#'
#' @field rewardAsset  character 
#'
#' @field APY  character 
#'
#' @field rewardAmt  character 
#'
#' @field extraRewardAsset  character 
#'
#' @field extraRewardAPY  character 
#'
#' @field estExtraRewardAmt  character 
#'
#' @field nextInterestPay  character 
#'
#' @field nextInterestPayDate  character 
#'
#' @field payInterestPeriod  character 
#'
#' @field redeemAmountEarly  character 
#'
#' @field interestEndDate  character 
#'
#' @field deliverDate  character 
#'
#' @field redeemPeriod  character 
#'
#' @field redeemingAmt  character 
#'
#' @field partialAmtDeliverDate  character 
#'
#' @field canRedeemEarly  character 
#'
#' @field renewable  character 
#'
#' @field type  character 
#'
#' @field status  character 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
InlineResponse20098 <- R6::R6Class(
  'InlineResponse20098',
  public = list(
    `positionId` = NULL,
    `projectId` = NULL,
    `asset` = NULL,
    `amount` = NULL,
    `purchaseTime` = NULL,
    `duration` = NULL,
    `accrualDays` = NULL,
    `rewardAsset` = NULL,
    `APY` = NULL,
    `rewardAmt` = NULL,
    `extraRewardAsset` = NULL,
    `extraRewardAPY` = NULL,
    `estExtraRewardAmt` = NULL,
    `nextInterestPay` = NULL,
    `nextInterestPayDate` = NULL,
    `payInterestPeriod` = NULL,
    `redeemAmountEarly` = NULL,
    `interestEndDate` = NULL,
    `deliverDate` = NULL,
    `redeemPeriod` = NULL,
    `redeemingAmt` = NULL,
    `partialAmtDeliverDate` = NULL,
    `canRedeemEarly` = NULL,
    `renewable` = NULL,
    `type` = NULL,
    `status` = NULL,
    initialize = function(
        `positionId`, `projectId`, `asset`, `amount`, `purchaseTime`, `duration`, `accrualDays`, `rewardAsset`, `APY`, `rewardAmt`, `extraRewardAsset`, `extraRewardAPY`, `estExtraRewardAmt`, `nextInterestPay`, `nextInterestPayDate`, `payInterestPeriod`, `redeemAmountEarly`, `interestEndDate`, `deliverDate`, `redeemPeriod`, `redeemingAmt`, `partialAmtDeliverDate`, `canRedeemEarly`, `renewable`, `type`, `status`, ...
    ) {
      local.optional.var <- list(...)
      if (!missing(`positionId`)) {
        stopifnot(is.character(`positionId`), length(`positionId`) == 1)
        self$`positionId` <- `positionId`
      }
      if (!missing(`projectId`)) {
        stopifnot(is.character(`projectId`), length(`projectId`) == 1)
        self$`projectId` <- `projectId`
      }
      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(`purchaseTime`)) {
        stopifnot(is.character(`purchaseTime`), length(`purchaseTime`) == 1)
        self$`purchaseTime` <- `purchaseTime`
      }
      if (!missing(`duration`)) {
        stopifnot(is.character(`duration`), length(`duration`) == 1)
        self$`duration` <- `duration`
      }
      if (!missing(`accrualDays`)) {
        stopifnot(is.character(`accrualDays`), length(`accrualDays`) == 1)
        self$`accrualDays` <- `accrualDays`
      }
      if (!missing(`rewardAsset`)) {
        stopifnot(is.character(`rewardAsset`), length(`rewardAsset`) == 1)
        self$`rewardAsset` <- `rewardAsset`
      }
      if (!missing(`APY`)) {
        stopifnot(is.character(`APY`), length(`APY`) == 1)
        self$`APY` <- `APY`
      }
      if (!missing(`rewardAmt`)) {
        stopifnot(is.character(`rewardAmt`), length(`rewardAmt`) == 1)
        self$`rewardAmt` <- `rewardAmt`
      }
      if (!missing(`extraRewardAsset`)) {
        stopifnot(is.character(`extraRewardAsset`), length(`extraRewardAsset`) == 1)
        self$`extraRewardAsset` <- `extraRewardAsset`
      }
      if (!missing(`extraRewardAPY`)) {
        stopifnot(is.character(`extraRewardAPY`), length(`extraRewardAPY`) == 1)
        self$`extraRewardAPY` <- `extraRewardAPY`
      }
      if (!missing(`estExtraRewardAmt`)) {
        stopifnot(is.character(`estExtraRewardAmt`), length(`estExtraRewardAmt`) == 1)
        self$`estExtraRewardAmt` <- `estExtraRewardAmt`
      }
      if (!missing(`nextInterestPay`)) {
        stopifnot(is.character(`nextInterestPay`), length(`nextInterestPay`) == 1)
        self$`nextInterestPay` <- `nextInterestPay`
      }
      if (!missing(`nextInterestPayDate`)) {
        stopifnot(is.character(`nextInterestPayDate`), length(`nextInterestPayDate`) == 1)
        self$`nextInterestPayDate` <- `nextInterestPayDate`
      }
      if (!missing(`payInterestPeriod`)) {
        stopifnot(is.character(`payInterestPeriod`), length(`payInterestPeriod`) == 1)
        self$`payInterestPeriod` <- `payInterestPeriod`
      }
      if (!missing(`redeemAmountEarly`)) {
        stopifnot(is.character(`redeemAmountEarly`), length(`redeemAmountEarly`) == 1)
        self$`redeemAmountEarly` <- `redeemAmountEarly`
      }
      if (!missing(`interestEndDate`)) {
        stopifnot(is.character(`interestEndDate`), length(`interestEndDate`) == 1)
        self$`interestEndDate` <- `interestEndDate`
      }
      if (!missing(`deliverDate`)) {
        stopifnot(is.character(`deliverDate`), length(`deliverDate`) == 1)
        self$`deliverDate` <- `deliverDate`
      }
      if (!missing(`redeemPeriod`)) {
        stopifnot(is.character(`redeemPeriod`), length(`redeemPeriod`) == 1)
        self$`redeemPeriod` <- `redeemPeriod`
      }
      if (!missing(`redeemingAmt`)) {
        stopifnot(is.character(`redeemingAmt`), length(`redeemingAmt`) == 1)
        self$`redeemingAmt` <- `redeemingAmt`
      }
      if (!missing(`partialAmtDeliverDate`)) {
        stopifnot(is.character(`partialAmtDeliverDate`), length(`partialAmtDeliverDate`) == 1)
        self$`partialAmtDeliverDate` <- `partialAmtDeliverDate`
      }
      if (!missing(`canRedeemEarly`)) {
        stopifnot(is.logical(`canRedeemEarly`), length(`canRedeemEarly`) == 1)
        self$`canRedeemEarly` <- `canRedeemEarly`
      }
      if (!missing(`renewable`)) {
        stopifnot(is.logical(`renewable`), length(`renewable`) == 1)
        self$`renewable` <- `renewable`
      }
      if (!missing(`type`)) {
        stopifnot(is.character(`type`), length(`type`) == 1)
        self$`type` <- `type`
      }
      if (!missing(`status`)) {
        stopifnot(is.character(`status`), length(`status`) == 1)
        self$`status` <- `status`
      }
    },
    toJSON = function() {
      InlineResponse20098Object <- list()
      if (!is.null(self$`positionId`)) {
        InlineResponse20098Object[['positionId']] <-
          self$`positionId`
      }
      if (!is.null(self$`projectId`)) {
        InlineResponse20098Object[['projectId']] <-
          self$`projectId`
      }
      if (!is.null(self$`asset`)) {
        InlineResponse20098Object[['asset']] <-
          self$`asset`
      }
      if (!is.null(self$`amount`)) {
        InlineResponse20098Object[['amount']] <-
          self$`amount`
      }
      if (!is.null(self$`purchaseTime`)) {
        InlineResponse20098Object[['purchaseTime']] <-
          self$`purchaseTime`
      }
      if (!is.null(self$`duration`)) {
        InlineResponse20098Object[['duration']] <-
          self$`duration`
      }
      if (!is.null(self$`accrualDays`)) {
        InlineResponse20098Object[['accrualDays']] <-
          self$`accrualDays`
      }
      if (!is.null(self$`rewardAsset`)) {
        InlineResponse20098Object[['rewardAsset']] <-
          self$`rewardAsset`
      }
      if (!is.null(self$`APY`)) {
        InlineResponse20098Object[['APY']] <-
          self$`APY`
      }
      if (!is.null(self$`rewardAmt`)) {
        InlineResponse20098Object[['rewardAmt']] <-
          self$`rewardAmt`
      }
      if (!is.null(self$`extraRewardAsset`)) {
        InlineResponse20098Object[['extraRewardAsset']] <-
          self$`extraRewardAsset`
      }
      if (!is.null(self$`extraRewardAPY`)) {
        InlineResponse20098Object[['extraRewardAPY']] <-
          self$`extraRewardAPY`
      }
      if (!is.null(self$`estExtraRewardAmt`)) {
        InlineResponse20098Object[['estExtraRewardAmt']] <-
          self$`estExtraRewardAmt`
      }
      if (!is.null(self$`nextInterestPay`)) {
        InlineResponse20098Object[['nextInterestPay']] <-
          self$`nextInterestPay`
      }
      if (!is.null(self$`nextInterestPayDate`)) {
        InlineResponse20098Object[['nextInterestPayDate']] <-
          self$`nextInterestPayDate`
      }
      if (!is.null(self$`payInterestPeriod`)) {
        InlineResponse20098Object[['payInterestPeriod']] <-
          self$`payInterestPeriod`
      }
      if (!is.null(self$`redeemAmountEarly`)) {
        InlineResponse20098Object[['redeemAmountEarly']] <-
          self$`redeemAmountEarly`
      }
      if (!is.null(self$`interestEndDate`)) {
        InlineResponse20098Object[['interestEndDate']] <-
          self$`interestEndDate`
      }
      if (!is.null(self$`deliverDate`)) {
        InlineResponse20098Object[['deliverDate']] <-
          self$`deliverDate`
      }
      if (!is.null(self$`redeemPeriod`)) {
        InlineResponse20098Object[['redeemPeriod']] <-
          self$`redeemPeriod`
      }
      if (!is.null(self$`redeemingAmt`)) {
        InlineResponse20098Object[['redeemingAmt']] <-
          self$`redeemingAmt`
      }
      if (!is.null(self$`partialAmtDeliverDate`)) {
        InlineResponse20098Object[['partialAmtDeliverDate']] <-
          self$`partialAmtDeliverDate`
      }
      if (!is.null(self$`canRedeemEarly`)) {
        InlineResponse20098Object[['canRedeemEarly']] <-
          self$`canRedeemEarly`
      }
      if (!is.null(self$`renewable`)) {
        InlineResponse20098Object[['renewable']] <-
          self$`renewable`
      }
      if (!is.null(self$`type`)) {
        InlineResponse20098Object[['type']] <-
          self$`type`
      }
      if (!is.null(self$`status`)) {
        InlineResponse20098Object[['status']] <-
          self$`status`
      }

      InlineResponse20098Object
    },
    fromJSON = function(InlineResponse20098Json) {
      InlineResponse20098Object <- jsonlite::fromJSON(InlineResponse20098Json)
      if (!is.null(InlineResponse20098Object$`positionId`)) {
        self$`positionId` <- InlineResponse20098Object$`positionId`
      }
      if (!is.null(InlineResponse20098Object$`projectId`)) {
        self$`projectId` <- InlineResponse20098Object$`projectId`
      }
      if (!is.null(InlineResponse20098Object$`asset`)) {
        self$`asset` <- InlineResponse20098Object$`asset`
      }
      if (!is.null(InlineResponse20098Object$`amount`)) {
        self$`amount` <- InlineResponse20098Object$`amount`
      }
      if (!is.null(InlineResponse20098Object$`purchaseTime`)) {
        self$`purchaseTime` <- InlineResponse20098Object$`purchaseTime`
      }
      if (!is.null(InlineResponse20098Object$`duration`)) {
        self$`duration` <- InlineResponse20098Object$`duration`
      }
      if (!is.null(InlineResponse20098Object$`accrualDays`)) {
        self$`accrualDays` <- InlineResponse20098Object$`accrualDays`
      }
      if (!is.null(InlineResponse20098Object$`rewardAsset`)) {
        self$`rewardAsset` <- InlineResponse20098Object$`rewardAsset`
      }
      if (!is.null(InlineResponse20098Object$`APY`)) {
        self$`APY` <- InlineResponse20098Object$`APY`
      }
      if (!is.null(InlineResponse20098Object$`rewardAmt`)) {
        self$`rewardAmt` <- InlineResponse20098Object$`rewardAmt`
      }
      if (!is.null(InlineResponse20098Object$`extraRewardAsset`)) {
        self$`extraRewardAsset` <- InlineResponse20098Object$`extraRewardAsset`
      }
      if (!is.null(InlineResponse20098Object$`extraRewardAPY`)) {
        self$`extraRewardAPY` <- InlineResponse20098Object$`extraRewardAPY`
      }
      if (!is.null(InlineResponse20098Object$`estExtraRewardAmt`)) {
        self$`estExtraRewardAmt` <- InlineResponse20098Object$`estExtraRewardAmt`
      }
      if (!is.null(InlineResponse20098Object$`nextInterestPay`)) {
        self$`nextInterestPay` <- InlineResponse20098Object$`nextInterestPay`
      }
      if (!is.null(InlineResponse20098Object$`nextInterestPayDate`)) {
        self$`nextInterestPayDate` <- InlineResponse20098Object$`nextInterestPayDate`
      }
      if (!is.null(InlineResponse20098Object$`payInterestPeriod`)) {
        self$`payInterestPeriod` <- InlineResponse20098Object$`payInterestPeriod`
      }
      if (!is.null(InlineResponse20098Object$`redeemAmountEarly`)) {
        self$`redeemAmountEarly` <- InlineResponse20098Object$`redeemAmountEarly`
      }
      if (!is.null(InlineResponse20098Object$`interestEndDate`)) {
        self$`interestEndDate` <- InlineResponse20098Object$`interestEndDate`
      }
      if (!is.null(InlineResponse20098Object$`deliverDate`)) {
        self$`deliverDate` <- InlineResponse20098Object$`deliverDate`
      }
      if (!is.null(InlineResponse20098Object$`redeemPeriod`)) {
        self$`redeemPeriod` <- InlineResponse20098Object$`redeemPeriod`
      }
      if (!is.null(InlineResponse20098Object$`redeemingAmt`)) {
        self$`redeemingAmt` <- InlineResponse20098Object$`redeemingAmt`
      }
      if (!is.null(InlineResponse20098Object$`partialAmtDeliverDate`)) {
        self$`partialAmtDeliverDate` <- InlineResponse20098Object$`partialAmtDeliverDate`
      }
      if (!is.null(InlineResponse20098Object$`canRedeemEarly`)) {
        self$`canRedeemEarly` <- InlineResponse20098Object$`canRedeemEarly`
      }
      if (!is.null(InlineResponse20098Object$`renewable`)) {
        self$`renewable` <- InlineResponse20098Object$`renewable`
      }
      if (!is.null(InlineResponse20098Object$`type`)) {
        self$`type` <- InlineResponse20098Object$`type`
      }
      if (!is.null(InlineResponse20098Object$`status`)) {
        self$`status` <- InlineResponse20098Object$`status`
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`positionId`)) {
        sprintf(
        '"positionId":
          "%s"
                ',
        self$`positionId`
        )},
        if (!is.null(self$`projectId`)) {
        sprintf(
        '"projectId":
          "%s"
                ',
        self$`projectId`
        )},
        if (!is.null(self$`asset`)) {
        sprintf(
        '"asset":
          "%s"
                ',
        self$`asset`
        )},
        if (!is.null(self$`amount`)) {
        sprintf(
        '"amount":
          "%s"
                ',
        self$`amount`
        )},
        if (!is.null(self$`purchaseTime`)) {
        sprintf(
        '"purchaseTime":
          "%s"
                ',
        self$`purchaseTime`
        )},
        if (!is.null(self$`duration`)) {
        sprintf(
        '"duration":
          "%s"
                ',
        self$`duration`
        )},
        if (!is.null(self$`accrualDays`)) {
        sprintf(
        '"accrualDays":
          "%s"
                ',
        self$`accrualDays`
        )},
        if (!is.null(self$`rewardAsset`)) {
        sprintf(
        '"rewardAsset":
          "%s"
                ',
        self$`rewardAsset`
        )},
        if (!is.null(self$`APY`)) {
        sprintf(
        '"APY":
          "%s"
                ',
        self$`APY`
        )},
        if (!is.null(self$`rewardAmt`)) {
        sprintf(
        '"rewardAmt":
          "%s"
                ',
        self$`rewardAmt`
        )},
        if (!is.null(self$`extraRewardAsset`)) {
        sprintf(
        '"extraRewardAsset":
          "%s"
                ',
        self$`extraRewardAsset`
        )},
        if (!is.null(self$`extraRewardAPY`)) {
        sprintf(
        '"extraRewardAPY":
          "%s"
                ',
        self$`extraRewardAPY`
        )},
        if (!is.null(self$`estExtraRewardAmt`)) {
        sprintf(
        '"estExtraRewardAmt":
          "%s"
                ',
        self$`estExtraRewardAmt`
        )},
        if (!is.null(self$`nextInterestPay`)) {
        sprintf(
        '"nextInterestPay":
          "%s"
                ',
        self$`nextInterestPay`
        )},
        if (!is.null(self$`nextInterestPayDate`)) {
        sprintf(
        '"nextInterestPayDate":
          "%s"
                ',
        self$`nextInterestPayDate`
        )},
        if (!is.null(self$`payInterestPeriod`)) {
        sprintf(
        '"payInterestPeriod":
          "%s"
                ',
        self$`payInterestPeriod`
        )},
        if (!is.null(self$`redeemAmountEarly`)) {
        sprintf(
        '"redeemAmountEarly":
          "%s"
                ',
        self$`redeemAmountEarly`
        )},
        if (!is.null(self$`interestEndDate`)) {
        sprintf(
        '"interestEndDate":
          "%s"
                ',
        self$`interestEndDate`
        )},
        if (!is.null(self$`deliverDate`)) {
        sprintf(
        '"deliverDate":
          "%s"
                ',
        self$`deliverDate`
        )},
        if (!is.null(self$`redeemPeriod`)) {
        sprintf(
        '"redeemPeriod":
          "%s"
                ',
        self$`redeemPeriod`
        )},
        if (!is.null(self$`redeemingAmt`)) {
        sprintf(
        '"redeemingAmt":
          "%s"
                ',
        self$`redeemingAmt`
        )},
        if (!is.null(self$`partialAmtDeliverDate`)) {
        sprintf(
        '"partialAmtDeliverDate":
          "%s"
                ',
        self$`partialAmtDeliverDate`
        )},
        if (!is.null(self$`canRedeemEarly`)) {
        sprintf(
        '"canRedeemEarly":
          %s
                ',
        tolower(self$`canRedeemEarly`)
        )},
        if (!is.null(self$`renewable`)) {
        sprintf(
        '"renewable":
          %s
                ',
        tolower(self$`renewable`)
        )},
        if (!is.null(self$`type`)) {
        sprintf(
        '"type":
          "%s"
                ',
        self$`type`
        )},
        if (!is.null(self$`status`)) {
        sprintf(
        '"status":
          "%s"
                ',
        self$`status`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(InlineResponse20098Json) {
      InlineResponse20098Object <- jsonlite::fromJSON(InlineResponse20098Json)
      self$`positionId` <- InlineResponse20098Object$`positionId`
      self$`projectId` <- InlineResponse20098Object$`projectId`
      self$`asset` <- InlineResponse20098Object$`asset`
      self$`amount` <- InlineResponse20098Object$`amount`
      self$`purchaseTime` <- InlineResponse20098Object$`purchaseTime`
      self$`duration` <- InlineResponse20098Object$`duration`
      self$`accrualDays` <- InlineResponse20098Object$`accrualDays`
      self$`rewardAsset` <- InlineResponse20098Object$`rewardAsset`
      self$`APY` <- InlineResponse20098Object$`APY`
      self$`rewardAmt` <- InlineResponse20098Object$`rewardAmt`
      self$`extraRewardAsset` <- InlineResponse20098Object$`extraRewardAsset`
      self$`extraRewardAPY` <- InlineResponse20098Object$`extraRewardAPY`
      self$`estExtraRewardAmt` <- InlineResponse20098Object$`estExtraRewardAmt`
      self$`nextInterestPay` <- InlineResponse20098Object$`nextInterestPay`
      self$`nextInterestPayDate` <- InlineResponse20098Object$`nextInterestPayDate`
      self$`payInterestPeriod` <- InlineResponse20098Object$`payInterestPeriod`
      self$`redeemAmountEarly` <- InlineResponse20098Object$`redeemAmountEarly`
      self$`interestEndDate` <- InlineResponse20098Object$`interestEndDate`
      self$`deliverDate` <- InlineResponse20098Object$`deliverDate`
      self$`redeemPeriod` <- InlineResponse20098Object$`redeemPeriod`
      self$`redeemingAmt` <- InlineResponse20098Object$`redeemingAmt`
      self$`partialAmtDeliverDate` <- InlineResponse20098Object$`partialAmtDeliverDate`
      self$`canRedeemEarly` <- InlineResponse20098Object$`canRedeemEarly`
      self$`renewable` <- InlineResponse20098Object$`renewable`
      self$`type` <- InlineResponse20098Object$`type`
      self$`status` <- InlineResponse20098Object$`status`
      self
    }
  )
)
grahamjwhite/binanceRapi documentation built on Nov. 22, 2022, 9:37 p.m.