R/inline_response20018_rows.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 InlineResponse20018Rows
#'
#' @description InlineResponse20018Rows Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field avgPrice  character 
#'
#' @field executedQty  character 
#'
#' @field orderId  integer 
#'
#' @field price  character 
#'
#' @field qty  character 
#'
#' @field side  character 
#'
#' @field symbol  character 
#'
#' @field timeInForce  character 
#'
#' @field isIsolated  character 
#'
#' @field updatedTime  integer 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
InlineResponse20018Rows <- R6::R6Class(
  'InlineResponse20018Rows',
  public = list(
    `avgPrice` = NULL,
    `executedQty` = NULL,
    `orderId` = NULL,
    `price` = NULL,
    `qty` = NULL,
    `side` = NULL,
    `symbol` = NULL,
    `timeInForce` = NULL,
    `isIsolated` = NULL,
    `updatedTime` = NULL,
    initialize = function(
        `avgPrice`, `executedQty`, `orderId`, `price`, `qty`, `side`, `symbol`, `timeInForce`, `isIsolated`, `updatedTime`, ...
    ) {
      local.optional.var <- list(...)
      if (!missing(`avgPrice`)) {
        stopifnot(is.character(`avgPrice`), length(`avgPrice`) == 1)
        self$`avgPrice` <- `avgPrice`
      }
      if (!missing(`executedQty`)) {
        stopifnot(is.character(`executedQty`), length(`executedQty`) == 1)
        self$`executedQty` <- `executedQty`
      }
      if (!missing(`orderId`)) {
        stopifnot(is.numeric(`orderId`), length(`orderId`) == 1)
        self$`orderId` <- `orderId`
      }
      if (!missing(`price`)) {
        stopifnot(is.character(`price`), length(`price`) == 1)
        self$`price` <- `price`
      }
      if (!missing(`qty`)) {
        stopifnot(is.character(`qty`), length(`qty`) == 1)
        self$`qty` <- `qty`
      }
      if (!missing(`side`)) {
        stopifnot(is.character(`side`), length(`side`) == 1)
        self$`side` <- `side`
      }
      if (!missing(`symbol`)) {
        stopifnot(is.character(`symbol`), length(`symbol`) == 1)
        self$`symbol` <- `symbol`
      }
      if (!missing(`timeInForce`)) {
        stopifnot(is.character(`timeInForce`), length(`timeInForce`) == 1)
        self$`timeInForce` <- `timeInForce`
      }
      if (!missing(`isIsolated`)) {
        stopifnot(is.logical(`isIsolated`), length(`isIsolated`) == 1)
        self$`isIsolated` <- `isIsolated`
      }
      if (!missing(`updatedTime`)) {
        stopifnot(is.numeric(`updatedTime`), length(`updatedTime`) == 1)
        self$`updatedTime` <- `updatedTime`
      }
    },
    toJSON = function() {
      InlineResponse20018RowsObject <- list()
      if (!is.null(self$`avgPrice`)) {
        InlineResponse20018RowsObject[['avgPrice']] <-
          self$`avgPrice`
      }
      if (!is.null(self$`executedQty`)) {
        InlineResponse20018RowsObject[['executedQty']] <-
          self$`executedQty`
      }
      if (!is.null(self$`orderId`)) {
        InlineResponse20018RowsObject[['orderId']] <-
          self$`orderId`
      }
      if (!is.null(self$`price`)) {
        InlineResponse20018RowsObject[['price']] <-
          self$`price`
      }
      if (!is.null(self$`qty`)) {
        InlineResponse20018RowsObject[['qty']] <-
          self$`qty`
      }
      if (!is.null(self$`side`)) {
        InlineResponse20018RowsObject[['side']] <-
          self$`side`
      }
      if (!is.null(self$`symbol`)) {
        InlineResponse20018RowsObject[['symbol']] <-
          self$`symbol`
      }
      if (!is.null(self$`timeInForce`)) {
        InlineResponse20018RowsObject[['timeInForce']] <-
          self$`timeInForce`
      }
      if (!is.null(self$`isIsolated`)) {
        InlineResponse20018RowsObject[['isIsolated']] <-
          self$`isIsolated`
      }
      if (!is.null(self$`updatedTime`)) {
        InlineResponse20018RowsObject[['updatedTime']] <-
          self$`updatedTime`
      }

      InlineResponse20018RowsObject
    },
    fromJSON = function(InlineResponse20018RowsJson) {
      InlineResponse20018RowsObject <- jsonlite::fromJSON(InlineResponse20018RowsJson)
      if (!is.null(InlineResponse20018RowsObject$`avgPrice`)) {
        self$`avgPrice` <- InlineResponse20018RowsObject$`avgPrice`
      }
      if (!is.null(InlineResponse20018RowsObject$`executedQty`)) {
        self$`executedQty` <- InlineResponse20018RowsObject$`executedQty`
      }
      if (!is.null(InlineResponse20018RowsObject$`orderId`)) {
        self$`orderId` <- InlineResponse20018RowsObject$`orderId`
      }
      if (!is.null(InlineResponse20018RowsObject$`price`)) {
        self$`price` <- InlineResponse20018RowsObject$`price`
      }
      if (!is.null(InlineResponse20018RowsObject$`qty`)) {
        self$`qty` <- InlineResponse20018RowsObject$`qty`
      }
      if (!is.null(InlineResponse20018RowsObject$`side`)) {
        self$`side` <- InlineResponse20018RowsObject$`side`
      }
      if (!is.null(InlineResponse20018RowsObject$`symbol`)) {
        self$`symbol` <- InlineResponse20018RowsObject$`symbol`
      }
      if (!is.null(InlineResponse20018RowsObject$`timeInForce`)) {
        self$`timeInForce` <- InlineResponse20018RowsObject$`timeInForce`
      }
      if (!is.null(InlineResponse20018RowsObject$`isIsolated`)) {
        self$`isIsolated` <- InlineResponse20018RowsObject$`isIsolated`
      }
      if (!is.null(InlineResponse20018RowsObject$`updatedTime`)) {
        self$`updatedTime` <- InlineResponse20018RowsObject$`updatedTime`
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`avgPrice`)) {
        sprintf(
        '"avgPrice":
          "%s"
                ',
        self$`avgPrice`
        )},
        if (!is.null(self$`executedQty`)) {
        sprintf(
        '"executedQty":
          "%s"
                ',
        self$`executedQty`
        )},
        if (!is.null(self$`orderId`)) {
        sprintf(
        '"orderId":
          %d
                ',
        self$`orderId`
        )},
        if (!is.null(self$`price`)) {
        sprintf(
        '"price":
          "%s"
                ',
        self$`price`
        )},
        if (!is.null(self$`qty`)) {
        sprintf(
        '"qty":
          "%s"
                ',
        self$`qty`
        )},
        if (!is.null(self$`side`)) {
        sprintf(
        '"side":
          "%s"
                ',
        self$`side`
        )},
        if (!is.null(self$`symbol`)) {
        sprintf(
        '"symbol":
          "%s"
                ',
        self$`symbol`
        )},
        if (!is.null(self$`timeInForce`)) {
        sprintf(
        '"timeInForce":
          "%s"
                ',
        self$`timeInForce`
        )},
        if (!is.null(self$`isIsolated`)) {
        sprintf(
        '"isIsolated":
          %s
                ',
        tolower(self$`isIsolated`)
        )},
        if (!is.null(self$`updatedTime`)) {
        sprintf(
        '"updatedTime":
          %d
                ',
        self$`updatedTime`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(InlineResponse20018RowsJson) {
      InlineResponse20018RowsObject <- jsonlite::fromJSON(InlineResponse20018RowsJson)
      self$`avgPrice` <- InlineResponse20018RowsObject$`avgPrice`
      self$`executedQty` <- InlineResponse20018RowsObject$`executedQty`
      self$`orderId` <- InlineResponse20018RowsObject$`orderId`
      self$`price` <- InlineResponse20018RowsObject$`price`
      self$`qty` <- InlineResponse20018RowsObject$`qty`
      self$`side` <- InlineResponse20018RowsObject$`side`
      self$`symbol` <- InlineResponse20018RowsObject$`symbol`
      self$`timeInForce` <- InlineResponse20018RowsObject$`timeInForce`
      self$`isIsolated` <- InlineResponse20018RowsObject$`isIsolated`
      self$`updatedTime` <- InlineResponse20018RowsObject$`updatedTime`
      self
    }
  )
)
grahamjwhite/binanceRapi documentation built on Nov. 22, 2022, 9:37 p.m.