5#ifndef JSONRPC_CPP_STUB_STUBCLIENT_H_
6#define JSONRPC_CPP_STUB_STUBCLIENT_H_
8#include <jsonrpccpp/client.h>
13 StubClient(jsonrpc::IClientConnector &conn, jsonrpc::clientVersion_t type = jsonrpc::JSONRPC_CLIENT_V2) : jsonrpc::Client(conn, type) {}
15 std::string aria2_addUri(
const std::string& param01,
const Json::Value& param02,
const Json::Value& param03,
int param04)
22 Json::Value result = this->CallMethod(
"aria2.addUri",p);
23 if (result.isString())
24 return result.asString();
26 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
28 std::string aria2_remove(
const std::string& param01,
const std::string& param02)
33 Json::Value result = this->CallMethod(
"aria2.remove",p);
34 if (result.isString())
35 return result.asString();
37 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
39 std::string aria2_forceRemove(
const std::string& param01,
const std::string& param02)
44 Json::Value result = this->CallMethod(
"aria2.forceRemove",p);
45 if (result.isString())
46 return result.asString();
48 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
50 std::string aria2_pause(
const std::string& param01,
const std::string& param02)
55 Json::Value result = this->CallMethod(
"aria2.pause",p);
56 if (result.isString())
57 return result.asString();
59 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
61 std::string aria2_pauseAll(
const std::string& param01)
65 Json::Value result = this->CallMethod(
"aria2.pauseAll",p);
66 if (result.isString())
67 return result.asString();
69 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
71 std::string aria2_forcePause(
const std::string& param01,
const std::string& param02)
76 Json::Value result = this->CallMethod(
"aria2.forcePause",p);
77 if (result.isString())
78 return result.asString();
80 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
82 Json::Value aria2_getGlobalOption(
const std::string& param01)
86 Json::Value result = this->CallMethod(
"aria2.getGlobalOption",p);
87 if (result.isObject())
90 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
92 std::string aria2_changeGlobalOption(
const std::string& param01,
const Json::Value& param02)
97 Json::Value result = this->CallMethod(
"aria2.changeGlobalOption",p);
98 if (result.isString())
99 return result.asString();
101 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
103 std::string aria2_forcePauseAll(
const std::string& param01)
107 Json::Value result = this->CallMethod(
"aria2.forcePauseAll",p);
108 if (result.isString())
109 return result.asString();
111 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
113 std::string aria2_unpause(
const std::string& param01,
const std::string& param02)
118 Json::Value result = this->CallMethod(
"aria2.unpause",p);
119 if (result.isString())
120 return result.asString();
122 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
124 std::string aria2_unPauseAll(
const std::string& param01)
128 Json::Value result = this->CallMethod(
"aria2.unPauseAll",p);
129 if (result.isString())
130 return result.asString();
132 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
134 Json::Value aria2_getGlobalStat(
const std::string& param01)
138 Json::Value result = this->CallMethod(
"aria2.getGlobalStat",p);
139 if (result.isArray())
142 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
144 Json::Value aria2_getVersion(
const std::string& param01)
148 Json::Value result = this->CallMethod(
"aria2.getVersion",p);
149 if (result.isObject())
152 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
154 std::string aria2_addTorrent(
const std::string& param01,
const std::string& param02,
const Json::Value& param03,
const Json::Value& param04,
int param05)
162 Json::Value result = this->CallMethod(
"aria2.addTorrent",p);
163 if (result.isString())
164 return result.asString();
166 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
168 Json::Value aria2_addMetalink(
const std::string& param01,
const std::string& param02,
const Json::Value& param03,
int param04)
175 Json::Value result = this->CallMethod(
"aria2.addMetalink",p);
176 if (result.isArray())
179 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
181 Json::Value aria2_getSessionInfo(
const std::string& param01)
185 Json::Value result = this->CallMethod(
"aria2.getSessionInfo",p);
186 if (result.isObject())
189 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
191 Json::Value aria2_tellStatus(
const std::string& param01,
const std::string& param02,
const Json::Value& param03)
197 Json::Value result = this->CallMethod(
"aria2.tellStatus",p);
198 if (result.isObject())
201 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
203 Json::Value aria2_getUris(
const std::string& param01,
const std::string& param02)
208 Json::Value result = this->CallMethod(
"aria2.getUris",p);
209 if (result.isArray())
212 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
214 Json::Value aria2_getFiles(
const std::string& param01,
const std::string& param02)
219 Json::Value result = this->CallMethod(
"aria2.getFiles",p);
220 if (result.isArray())
223 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
225 Json::Value aria2_tellActive(
const std::string& param01,
const Json::Value& param02)
230 Json::Value result = this->CallMethod(
"aria2.tellActive",p);
231 if (result.isArray())
234 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
236 Json::Value aria2_tellWaiting(
const std::string& param01,
int param02,
int param03,
const Json::Value& param04)
243 Json::Value result = this->CallMethod(
"aria2.tellWaiting",p);
244 if (result.isArray())
247 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
249 Json::Value aria2_tellStopped(
const std::string& param01,
int param02,
int param03,
const Json::Value& param04)
256 Json::Value result = this->CallMethod(
"aria2.tellStopped",p);
257 if (result.isArray())
260 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
262 int aria2_changePosition(
const std::string& param01,
const std::string& param02,
int param03,
const std::string& param04)
269 Json::Value result = this->CallMethod(
"aria2.changePosition",p);
270 if (result.isIntegral())
271 return result.asInt();
273 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
275 Json::Value aria2_getOption(
const std::string& param01,
const std::string& param02)
280 Json::Value result = this->CallMethod(
"aria2.getOption",p);
281 if (result.isArray())
284 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
286 std::string aria2_purgeDownloadResult(
const std::string& param01)
290 Json::Value result = this->CallMethod(
"aria2.purgeDownloadResult",p);
291 if (result.isString())
292 return result.asString();
294 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
296 std::string aria2_removeDownloadResult(
const std::string& param01,
const std::string& param02)
301 Json::Value result = this->CallMethod(
"aria2.removeDownloadResult",p);
302 if (result.isString())
303 return result.asString();
305 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
307 std::string aria2_shutdown(
const std::string& param01)
311 Json::Value result = this->CallMethod(
"aria2.shutdown",p);
312 if (result.isString())
313 return result.asString();
315 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
317 std::string aria2_forceShutdown(
const std::string& param01)
321 Json::Value result = this->CallMethod(
"aria2.forceShutdown",p);
322 if (result.isString())
323 return result.asString();
325 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
327 std::string aria2_saveSession(
const std::string& param01)
331 Json::Value result = this->CallMethod(
"aria2.saveSession",p);
332 if (result.isString())
333 return result.asString();
335 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
337 Json::Value aria2_getPeers(
const std::string& param01,
const std::string& param02)
342 Json::Value result = this->CallMethod(
"aria2.getPeers",p);
343 if (result.isArray())
346 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
348 Json::Value aria2_getServers(
const std::string& param01,
const std::string& param02)
353 Json::Value result = this->CallMethod(
"aria2.getServers",p);
354 if (result.isArray())
357 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
359 Json::Value aria2_changeUri(
const std::string& param01,
const std::string& param02,
const std::string& param03,
const std::string& param04,
const std::string& param05,
const std::string& param06)
368 Json::Value result = this->CallMethod(
"aria2.changeUri",p);
369 if (result.isArray())
372 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
374 Json::Value system_listMethods(
const std::string& param01)
378 Json::Value result = this->CallMethod(
"system.listMethods",p);
379 if (result.isArray())
382 throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());