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

      InlineResponse2005OrdersObject
    },
    fromJSON = function(InlineResponse2005OrdersJson) {
      InlineResponse2005OrdersObject <- jsonlite::fromJSON(InlineResponse2005OrdersJson)
      if (!is.null(InlineResponse2005OrdersObject$`symbol`)) {
        self$`symbol` <- InlineResponse2005OrdersObject$`symbol`
      }
      if (!is.null(InlineResponse2005OrdersObject$`orderId`)) {
        self$`orderId` <- InlineResponse2005OrdersObject$`orderId`
      }
      if (!is.null(InlineResponse2005OrdersObject$`clientOrderId`)) {
        self$`clientOrderId` <- InlineResponse2005OrdersObject$`clientOrderId`
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`symbol`)) {
        sprintf(
        '"symbol":
          "%s"
                ',
        self$`symbol`
        )},
        if (!is.null(self$`orderId`)) {
        sprintf(
        '"orderId":
          %d
                ',
        self$`orderId`
        )},
        if (!is.null(self$`clientOrderId`)) {
        sprintf(
        '"clientOrderId":
          "%s"
                ',
        self$`clientOrderId`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(InlineResponse2005OrdersJson) {
      InlineResponse2005OrdersObject <- jsonlite::fromJSON(InlineResponse2005OrdersJson)
      self$`symbol` <- InlineResponse2005OrdersObject$`symbol`
      self$`orderId` <- InlineResponse2005OrdersObject$`orderId`
      self$`clientOrderId` <- InlineResponse2005OrdersObject$`clientOrderId`
      self
    }
  )
)
grahamjwhite/binanceRapi documentation built on Nov. 22, 2022, 9:37 p.m.