1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-18 14:21:49 -05:00
sdrangel/swagger/sdrangel/code/qt5/client/SWGDefaultApi.cpp

845 lines
20 KiB
C++
Raw Normal View History

/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SWGDefaultApi.h"
#include "SWGHelpers.h"
#include "SWGModelFactory.h"
#include <QJsonArray>
#include <QJsonDocument>
namespace Swagger {
SWGDefaultApi::SWGDefaultApi() {}
SWGDefaultApi::~SWGDefaultApi() {}
SWGDefaultApi::SWGDefaultApi(QString host, QString basePath) {
this->host = host;
this->basePath = basePath;
}
void
SWGDefaultApi::instanceAudioGet() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/audio");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceAudioGetCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceAudioGetCallback(HttpRequestWorker * worker) {
QString msg;
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);
SWGAudioDevices* output = static_cast<SWGAudioDevices*>(create(json, QString("SWGAudioDevices")));
worker->deleteLater();
emit instanceAudioGetSignal(output);
}
void
SWGDefaultApi::instanceAudioPatch(SWGAudioDevicesSelect body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/audio");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "PATCH");
QString output = body.asJson();
input.request_body.append(output);
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceAudioPatchCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceAudioPatchCallback(HttpRequestWorker * worker) {
QString msg;
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);
SWGAudioDevicesSelect* output = static_cast<SWGAudioDevicesSelect*>(create(json, QString("SWGAudioDevicesSelect")));
worker->deleteLater();
emit instanceAudioPatchSignal(output);
}
void
SWGDefaultApi::instanceChannels(bool tx) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/channels");
if (fullPath.indexOf("?") > 0)
fullPath.append("&");
else
fullPath.append("?");
fullPath.append(QUrl::toPercentEncoding("tx"))
.append("=")
.append(QUrl::toPercentEncoding(stringValue(tx)));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceChannelsCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceChannelsCallback(HttpRequestWorker * worker) {
QString msg;
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);
SWGInstanceChannelsResponse* output = static_cast<SWGInstanceChannelsResponse*>(create(json, QString("SWGInstanceChannelsResponse")));
worker->deleteLater();
emit instanceChannelsSignal(output);
}
void
SWGDefaultApi::instanceDVSerialPatch(bool dvserial) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/dvserial");
if (fullPath.indexOf("?") > 0)
fullPath.append("&");
else
fullPath.append("?");
fullPath.append(QUrl::toPercentEncoding("dvserial"))
.append("=")
.append(QUrl::toPercentEncoding(stringValue(dvserial)));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "PATCH");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceDVSerialPatchCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceDVSerialPatchCallback(HttpRequestWorker * worker) {
QString msg;
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);
SWGDVSeralDevices* output = static_cast<SWGDVSeralDevices*>(create(json, QString("SWGDVSeralDevices")));
worker->deleteLater();
emit instanceDVSerialPatchSignal(output);
}
void
SWGDefaultApi::instanceDeviceSetsDelete() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/devicesets");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "DELETE");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceDeviceSetsDeleteCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceDeviceSetsDeleteCallback(HttpRequestWorker * worker) {
QString msg;
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);
SWGDeviceSetList* output = static_cast<SWGDeviceSetList*>(create(json, QString("SWGDeviceSetList")));
worker->deleteLater();
emit instanceDeviceSetsDeleteSignal(output);
}
void
SWGDefaultApi::instanceDeviceSetsGet() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/devicesets");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceDeviceSetsGetCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceDeviceSetsGetCallback(HttpRequestWorker * worker) {
QString msg;
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);
SWGDeviceSetList* output = static_cast<SWGDeviceSetList*>(create(json, QString("SWGDeviceSetList")));
worker->deleteLater();
emit instanceDeviceSetsGetSignal(output);
}
void
SWGDefaultApi::instanceDeviceSetsPost(bool tx) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/devicesets");
if (fullPath.indexOf("?") > 0)
fullPath.append("&");
else
fullPath.append("?");
fullPath.append(QUrl::toPercentEncoding("tx"))
.append("=")
.append(QUrl::toPercentEncoding(stringValue(tx)));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "POST");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceDeviceSetsPostCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceDeviceSetsPostCallback(HttpRequestWorker * worker) {
QString msg;
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);
SWGDeviceSet* output = static_cast<SWGDeviceSet*>(create(json, QString("SWGDeviceSet")));
worker->deleteLater();
emit instanceDeviceSetsPostSignal(output);
}
void
SWGDefaultApi::instanceDevices(bool tx) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/devices");
if (fullPath.indexOf("?") > 0)
fullPath.append("&");
else
fullPath.append("?");
fullPath.append(QUrl::toPercentEncoding("tx"))
.append("=")
.append(QUrl::toPercentEncoding(stringValue(tx)));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceDevicesCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceDevicesCallback(HttpRequestWorker * worker) {
QString msg;
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);
SWGInstanceDevicesResponse* output = static_cast<SWGInstanceDevicesResponse*>(create(json, QString("SWGInstanceDevicesResponse")));
worker->deleteLater();
emit instanceDevicesSignal(output);
}
void
SWGDefaultApi::instanceLocationGet() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/location");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceLocationGetCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceLocationGetCallback(HttpRequestWorker * worker) {
QString msg;
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);
SWGLocationInformation* output = static_cast<SWGLocationInformation*>(create(json, QString("SWGLocationInformation")));
worker->deleteLater();
emit instanceLocationGetSignal(output);
}
void
SWGDefaultApi::instanceLocationPut(SWGLocationInformation body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/location");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "PUT");
QString output = body.asJson();
input.request_body.append(output);
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceLocationPutCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceLocationPutCallback(HttpRequestWorker * worker) {
QString msg;
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);
SWGLocationInformation* output = static_cast<SWGLocationInformation*>(create(json, QString("SWGLocationInformation")));
worker->deleteLater();
emit instanceLocationPutSignal(output);
}
void
SWGDefaultApi::instanceLoggingGet() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/logging");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceLoggingGetCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceLoggingGetCallback(HttpRequestWorker * worker) {
QString msg;
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);
SWGLoggingInfo* output = static_cast<SWGLoggingInfo*>(create(json, QString("SWGLoggingInfo")));
worker->deleteLater();
emit instanceLoggingGetSignal(output);
}
void
SWGDefaultApi::instanceLoggingPut(SWGLoggingInfo body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/logging");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "PUT");
QString output = body.asJson();
input.request_body.append(output);
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceLoggingPutCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceLoggingPutCallback(HttpRequestWorker * worker) {
QString msg;
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);
SWGLoggingInfo* output = static_cast<SWGLoggingInfo*>(create(json, QString("SWGLoggingInfo")));
worker->deleteLater();
emit instanceLoggingPutSignal(output);
}
void
SWGDefaultApi::instancePresetDelete(SWGPresetIdentifier body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/preset");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "DELETE");
QString output = body.asJson();
input.request_body.append(output);
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instancePresetDeleteCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instancePresetDeleteCallback(HttpRequestWorker * worker) {
QString msg;
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);
SWGPresetIdentifier* output = static_cast<SWGPresetIdentifier*>(create(json, QString("SWGPresetIdentifier")));
worker->deleteLater();
emit instancePresetDeleteSignal(output);
}
void
SWGDefaultApi::instancePresetGet() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/preset");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instancePresetGetCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instancePresetGetCallback(HttpRequestWorker * worker) {
QString msg;
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);
SWGPresets* output = static_cast<SWGPresets*>(create(json, QString("SWGPresets")));
worker->deleteLater();
emit instancePresetGetSignal(output);
}
void
SWGDefaultApi::instancePresetPatch(SWGPresetTransfer body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/preset");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "PATCH");
QString output = body.asJson();
input.request_body.append(output);
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instancePresetPatchCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instancePresetPatchCallback(HttpRequestWorker * worker) {
QString msg;
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);
SWGPresetIdentifier* output = static_cast<SWGPresetIdentifier*>(create(json, QString("SWGPresetIdentifier")));
worker->deleteLater();
emit instancePresetPatchSignal(output);
}
void
SWGDefaultApi::instancePresetPost(SWGPresetTransfer body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/preset");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "POST");
QString output = body.asJson();
input.request_body.append(output);
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instancePresetPostCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instancePresetPostCallback(HttpRequestWorker * worker) {
QString msg;
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);
SWGPresetIdentifier* output = static_cast<SWGPresetIdentifier*>(create(json, QString("SWGPresetIdentifier")));
worker->deleteLater();
emit instancePresetPostSignal(output);
}
void
SWGDefaultApi::instancePresetPut(SWGPresetTransfer body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/preset");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "PUT");
QString output = body.asJson();
input.request_body.append(output);
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instancePresetPutCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instancePresetPutCallback(HttpRequestWorker * worker) {
QString msg;
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);
SWGPresetIdentifier* output = static_cast<SWGPresetIdentifier*>(create(json, QString("SWGPresetIdentifier")));
worker->deleteLater();
emit instancePresetPutSignal(output);
}
void
SWGDefaultApi::instanceSummary() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGDefaultApi::instanceSummaryCallback);
worker->execute(&input);
}
void
SWGDefaultApi::instanceSummaryCallback(HttpRequestWorker * worker) {
QString msg;
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);
SWGInstanceSummaryResponse* output = static_cast<SWGInstanceSummaryResponse*>(create(json, QString("SWGInstanceSummaryResponse")));
worker->deleteLater();
emit instanceSummarySignal(output);
}
} /* namespace Swagger */