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 "SWGCandleApi.h"
  #include "SWGHelpers.h"
  #include "SWGModelFactory.h"
  #include "SWGQObjectWrapper.h"
  
  #include <QJsonArray>
  #include <QJsonDocument>
  
  namespace Swagger {
  
  SWGCandleApi::SWGCandleApi() {}
  
  SWGCandleApi::~SWGCandleApi() {}
  
  SWGCandleApi::SWGCandleApi(QString host, QString basePath) {
      this->host = host;
      this->basePath = basePath;
  }
  
  void
  SWGCandleApi::candle_days(QString* market, QString* to, SWGNumber* count, QString* converting_price_unit) {
      QString fullPath;
      fullPath.append(this->host).append(this->basePath).append("/candles/days");
  
  
      if (fullPath.indexOf("?") > 0)
        fullPath.append("&");
      else
        fullPath.append("?");
      fullPath.append(QUrl::toPercentEncoding("market"))
          .append("=")
          .append(QUrl::toPercentEncoding(stringValue(market)));
  
      if (fullPath.indexOf("?") > 0)
        fullPath.append("&");
      else
        fullPath.append("?");
      fullPath.append(QUrl::toPercentEncoding("to"))
          .append("=")
          .append(QUrl::toPercentEncoding(stringValue(to)));
  
      if (fullPath.indexOf("?") > 0)
        fullPath.append("&");
      else
        fullPath.append("?");
      fullPath.append(QUrl::toPercentEncoding("count"))
          .append("=")
          .append(QUrl::toPercentEncoding(stringValue(count)));
  
      if (fullPath.indexOf("?") > 0)
        fullPath.append("&");
      else
        fullPath.append("?");
      fullPath.append(QUrl::toPercentEncoding("convertingPriceUnit"))
          .append("=")
          .append(QUrl::toPercentEncoding(stringValue(converting_price_unit)));
  
  
      SWGHttpRequestWorker *worker = new SWGHttpRequestWorker();
      SWGHttpRequestInput input(fullPath, "GET");
  
  
  
  
  
      foreach(QString key, this->defaultHeaders.keys()) {
          input.headers.insert(key, this->defaultHeaders.value(key));
      }
  
      connect(worker,
              &SWGHttpRequestWorker::on_execution_finished,
              this,
              &SWGCandleApi::candle_daysCallback);
  
      worker->execute(&input);
  }
  
  void
  SWGCandleApi::candle_daysCallback(SWGHttpRequestWorker * worker) {
      QString msg;
      QString error_str = worker->error_str;
      QNetworkReply::NetworkError error_type = worker->error_type;
  
      if (worker->error_type == QNetworkReply::NoError) {
          msg = QString("Success! %1 bytes").arg(worker->response.length());
      }
      else {
          msg = "Error: " + worker->error_str;
      }
  
      QString json(worker->response);
      SWGObject* output = static_cast<SWGObject*>(create(json, QString("SWGObject")));
      auto wrapper = new SWGQObjectWrapper<SWGObject*> (output);
      wrapper->deleteLater();
      worker->deleteLater();
  
      if (worker->error_type == QNetworkReply::NoError) {
          emit candle_daysSignal(output);
      } else {
          emit candle_daysSignalE(output, error_type, error_str);
          emit candle_daysSignalEFull(worker, error_type, error_str);
      }
  }
  
  void
  SWGCandleApi::candle_minutes(qint32 unit, QString* market, QString* to, SWGNumber* count) {
      QString fullPath;
      fullPath.append(this->host).append(this->basePath).append("/candles/minutes/{unit}");
  
      QString unitPathParam("{"); unitPathParam.append("unit").append("}");
      fullPath.replace(unitPathParam, stringValue(unit));
  
      if (fullPath.indexOf("?") > 0)
        fullPath.append("&");
      else
        fullPath.append("?");
      fullPath.append(QUrl::toPercentEncoding("market"))
          .append("=")
          .append(QUrl::toPercentEncoding(stringValue(market)));
  
      if (fullPath.indexOf("?") > 0)
        fullPath.append("&");
      else
        fullPath.append("?");
      fullPath.append(QUrl::toPercentEncoding("to"))
          .append("=")
          .append(QUrl::toPercentEncoding(stringValue(to)));
  
      if (fullPath.indexOf("?") > 0)
        fullPath.append("&");
      else
        fullPath.append("?");
      fullPath.append(QUrl::toPercentEncoding("count"))
          .append("=")
          .append(QUrl::toPercentEncoding(stringValue(count)));
  
  
      SWGHttpRequestWorker *worker = new SWGHttpRequestWorker();
      SWGHttpRequestInput input(fullPath, "GET");
  
  
  
  
  
      foreach(QString key, this->defaultHeaders.keys()) {
          input.headers.insert(key, this->defaultHeaders.value(key));
      }
  
      connect(worker,
              &SWGHttpRequestWorker::on_execution_finished,
              this,
              &SWGCandleApi::candle_minutesCallback);
  
      worker->execute(&input);
  }
  
  void
  SWGCandleApi::candle_minutesCallback(SWGHttpRequestWorker * worker) {
      QString msg;
      QString error_str = worker->error_str;
      QNetworkReply::NetworkError error_type = worker->error_type;
  
      if (worker->error_type == QNetworkReply::NoError) {
          msg = QString("Success! %1 bytes").arg(worker->response.length());
      }
      else {
          msg = "Error: " + worker->error_str;
      }
  
      QString json(worker->response);
      SWGObject* output = static_cast<SWGObject*>(create(json, QString("SWGObject")));
      auto wrapper = new SWGQObjectWrapper<SWGObject*> (output);
      wrapper->deleteLater();
      worker->deleteLater();
  
      if (worker->error_type == QNetworkReply::NoError) {
          emit candle_minutesSignal(output);
      } else {
          emit candle_minutesSignalE(output, error_type, error_str);
          emit candle_minutesSignalEFull(worker, error_type, error_str);
      }
  }
  
  void
  SWGCandleApi::candle_month(QString* market, QString* to, SWGNumber* count) {
      QString fullPath;
      fullPath.append(this->host).append(this->basePath).append("/candles/months");
  
  
      if (fullPath.indexOf("?") > 0)
        fullPath.append("&");
      else
        fullPath.append("?");
      fullPath.append(QUrl::toPercentEncoding("market"))
          .append("=")
          .append(QUrl::toPercentEncoding(stringValue(market)));
  
      if (fullPath.indexOf("?") > 0)
        fullPath.append("&");
      else
        fullPath.append("?");
      fullPath.append(QUrl::toPercentEncoding("to"))
          .append("=")
          .append(QUrl::toPercentEncoding(stringValue(to)));
  
      if (fullPath.indexOf("?") > 0)
        fullPath.append("&");
      else
        fullPath.append("?");
      fullPath.append(QUrl::toPercentEncoding("count"))
          .append("=")
          .append(QUrl::toPercentEncoding(stringValue(count)));
  
  
      SWGHttpRequestWorker *worker = new SWGHttpRequestWorker();
      SWGHttpRequestInput input(fullPath, "GET");
  
  
  
  
  
      foreach(QString key, this->defaultHeaders.keys()) {
          input.headers.insert(key, this->defaultHeaders.value(key));
      }
  
      connect(worker,
              &SWGHttpRequestWorker::on_execution_finished,
              this,
              &SWGCandleApi::candle_monthCallback);
  
      worker->execute(&input);
  }
  
  void
  SWGCandleApi::candle_monthCallback(SWGHttpRequestWorker * worker) {
      QString msg;
      QString error_str = worker->error_str;
      QNetworkReply::NetworkError error_type = worker->error_type;
  
      if (worker->error_type == QNetworkReply::NoError) {
          msg = QString("Success! %1 bytes").arg(worker->response.length());
      }
      else {
          msg = "Error: " + worker->error_str;
      }
  
      QString json(worker->response);
      SWGObject* output = static_cast<SWGObject*>(create(json, QString("SWGObject")));
      auto wrapper = new SWGQObjectWrapper<SWGObject*> (output);
      wrapper->deleteLater();
      worker->deleteLater();
  
      if (worker->error_type == QNetworkReply::NoError) {
          emit candle_monthSignal(output);
      } else {
          emit candle_monthSignalE(output, error_type, error_str);
          emit candle_monthSignalEFull(worker, error_type, error_str);
      }
  }
  
  void
  SWGCandleApi::candle_weeks(QString* market, QString* to, SWGNumber* count) {
      QString fullPath;
      fullPath.append(this->host).append(this->basePath).append("/candles/weeks");
  
  
      if (fullPath.indexOf("?") > 0)
        fullPath.append("&");
      else
        fullPath.append("?");
      fullPath.append(QUrl::toPercentEncoding("market"))
          .append("=")
          .append(QUrl::toPercentEncoding(stringValue(market)));
  
      if (fullPath.indexOf("?") > 0)
        fullPath.append("&");
      else
        fullPath.append("?");
      fullPath.append(QUrl::toPercentEncoding("to"))
          .append("=")
          .append(QUrl::toPercentEncoding(stringValue(to)));
  
      if (fullPath.indexOf("?") > 0)
        fullPath.append("&");
      else
        fullPath.append("?");
      fullPath.append(QUrl::toPercentEncoding("count"))
          .append("=")
          .append(QUrl::toPercentEncoding(stringValue(count)));
  
  
      SWGHttpRequestWorker *worker = new SWGHttpRequestWorker();
      SWGHttpRequestInput input(fullPath, "GET");
  
  
  
  
  
      foreach(QString key, this->defaultHeaders.keys()) {
          input.headers.insert(key, this->defaultHeaders.value(key));
      }
  
      connect(worker,
              &SWGHttpRequestWorker::on_execution_finished,
              this,
              &SWGCandleApi::candle_weeksCallback);
  
      worker->execute(&input);
  }
  
  void
  SWGCandleApi::candle_weeksCallback(SWGHttpRequestWorker * worker) {
      QString msg;
      QString error_str = worker->error_str;
      QNetworkReply::NetworkError error_type = worker->error_type;
  
      if (worker->error_type == QNetworkReply::NoError) {
          msg = QString("Success! %1 bytes").arg(worker->response.length());
      }
      else {
          msg = "Error: " + worker->error_str;
      }
  
      QString json(worker->response);
      SWGObject* output = static_cast<SWGObject*>(create(json, QString("SWGObject")));
      auto wrapper = new SWGQObjectWrapper<SWGObject*> (output);
      wrapper->deleteLater();
      worker->deleteLater();
  
      if (worker->error_type == QNetworkReply::NoError) {
          emit candle_weeksSignal(output);
      } else {
          emit candle_weeksSignalE(output, error_type, error_str);
          emit candle_weeksSignalEFull(worker, error_type, error_str);
      }
  }
  
  
  }
  