text: /**
   * Upbit Open API
   * ## REST API for Upbit Exchange - Base URL: [https://api.upbit.com] - Official Upbit API Documents: [https://docs.upbit.com] - Official Support email: [open-api@upbit.com] 
   *
   * OpenAPI spec version: 1.0.0
   * Contact: ujhin942@gmail.com
   *
   * NOTE: This class is auto generated by the swagger code generator program.
   * https://github.com/swagger-api/swagger-codegen.git
   * Do not edit the class manually.
   */
  
  
  #include "SWGOrderbook.h"
  
  #include "SWGHelpers.h"
  
  #include <QJsonDocument>
  #include <QJsonArray>
  #include <QObject>
  #include <QDebug>
  
  namespace Swagger {
  
  SWGOrderbook::SWGOrderbook(QString json) {
      init();
      this->fromJson(json);
  }
  
  SWGOrderbook::SWGOrderbook() {
      init();
  }
  
  SWGOrderbook::~SWGOrderbook() {
      this->cleanup();
  }
  
  void
  SWGOrderbook::init() {
      market = new QString("");
      m_market_isSet = false;
      timestamp = 0.0;
      m_timestamp_isSet = false;
      total_ask_size = 0.0;
      m_total_ask_size_isSet = false;
      total_bid_size = 0.0;
      m_total_bid_size_isSet = false;
      orderbook_units = new QList<SWGOrderbookUnit*>();
      m_orderbook_units_isSet = false;
  }
  
  void
  SWGOrderbook::cleanup() {
      if(market != nullptr) { 
          delete market;
      }
      if(timestamp != nullptr) { 
          delete timestamp;
      }
  
  
      if(orderbook_units != nullptr) { 
          auto arr = orderbook_units;
          for(auto o: *arr) { 
              delete o;
          }
          delete orderbook_units;
      }
  }
  
  SWGOrderbook*
  SWGOrderbook::fromJson(QString json) {
      QByteArray array (json.toStdString().c_str());
      QJsonDocument doc = QJsonDocument::fromJson(array);
      QJsonObject jsonObject = doc.object();
      this->fromJsonObject(jsonObject);
      return this;
  }
  
  void
  SWGOrderbook::fromJsonObject(QJsonObject pJson) {
      ::Swagger::setValue(&market, pJson["market"], "QString", "QString");
      
      ::Swagger::setValue(&timestamp, pJson["timestamp"], "SWGNumber", "SWGNumber");
      
      ::Swagger::setValue(&total_ask_size, pJson["total_ask_size"], "double", "");
      
      ::Swagger::setValue(&total_bid_size, pJson["total_bid_size"], "double", "");
      
      
      ::Swagger::setValue(&orderbook_units, pJson["orderbook_units"], "QList", "SWGOrderbookUnit");
  }
  
  QString
  SWGOrderbook::asJson ()
  {
      QJsonObject obj = this->asJsonObject();
      QJsonDocument doc(obj);
      QByteArray bytes = doc.toJson();
      return QString(bytes);
  }
  
  QJsonObject
  SWGOrderbook::asJsonObject() {
      QJsonObject obj;
      if(market != nullptr && *market != QString("")){
          toJsonValue(QString("market"), market, obj, QString("QString"));
      }
      if((timestamp != nullptr) && (timestamp->isSet())){
          toJsonValue(QString("timestamp"), timestamp, obj, QString("SWGNumber"));
      }
      if(m_total_ask_size_isSet){
          obj.insert("total_ask_size", QJsonValue(total_ask_size));
      }
      if(m_total_bid_size_isSet){
          obj.insert("total_bid_size", QJsonValue(total_bid_size));
      }
      if(orderbook_units->size() > 0){
          toJsonArray((QList<void*>*)orderbook_units, obj, "orderbook_units", "SWGOrderbookUnit");
      }
  
      return obj;
  }
  
  QString*
  SWGOrderbook::getMarket() {
      return market;
  }
  void
  SWGOrderbook::setMarket(QString* market) {
      this->market = market;
      this->m_market_isSet = true;
  }
  
  SWGNumber*
  SWGOrderbook::getTimestamp() {
      return timestamp;
  }
  void
  SWGOrderbook::setTimestamp(SWGNumber* timestamp) {
      this->timestamp = timestamp;
      this->m_timestamp_isSet = true;
  }
  
  double
  SWGOrderbook::getTotalAskSize() {
      return total_ask_size;
  }
  void
  SWGOrderbook::setTotalAskSize(double total_ask_size) {
      this->total_ask_size = total_ask_size;
      this->m_total_ask_size_isSet = true;
  }
  
  double
  SWGOrderbook::getTotalBidSize() {
      return total_bid_size;
  }
  void
  SWGOrderbook::setTotalBidSize(double total_bid_size) {
      this->total_bid_size = total_bid_size;
      this->m_total_bid_size_isSet = true;
  }
  
  QList<SWGOrderbookUnit*>*
  SWGOrderbook::getOrderbookUnits() {
      return orderbook_units;
  }
  void
  SWGOrderbook::setOrderbookUnits(QList<SWGOrderbookUnit*>* orderbook_units) {
      this->orderbook_units = orderbook_units;
      this->m_orderbook_units_isSet = true;
  }
  
  
  bool
  SWGOrderbook::isSet(){
      bool isObjectUpdated = false;
      do{
          if(market != nullptr && *market != QString("")){ isObjectUpdated = true; break;}
          if(timestamp != nullptr && timestamp->isSet()){ isObjectUpdated = true; break;}
          if(m_total_ask_size_isSet){ isObjectUpdated = true; break;}
          if(m_total_bid_size_isSet){ isObjectUpdated = true; break;}
          if(orderbook_units->size() > 0){ isObjectUpdated = true; break;}
      }while(false);
      return isObjectUpdated;
  }
  }
  
  