Monero
Loading...
Searching...
No Matches
jsonrpc_structs.h
Go to the documentation of this file.
1#ifndef JSONRPC_STRUCTS_H
2#define JSONRPC_STRUCTS_H
3
4#include <string>
5#include <cstdint>
8
9namespace epee
10{
11 namespace json_rpc
12 {
13 template<typename t_param>
14 struct request
15 {
16 std::string jsonrpc;
17 std::string method;
19 t_param params;
20
21 request(): id{}, params{} {}
22
25 KV_SERIALIZE(id)
29 };
30
31 struct error
32 {
34 std::string message;
35
36 error(): code(0) {}
37
40 KV_SERIALIZE(message)
42 };
43
45 {
48 };
49
51 {
54 };
55
56 template<typename t_param, typename t_error>
57 struct response
58 {
59 std::string jsonrpc;
60 t_param result;
62 t_error error;
63
64 response(): result{}, id(), error{} {}
65
67 KV_SERIALIZE(jsonrpc)
68 KV_SERIALIZE(id)
72 };
73
74 template<typename t_param>
75 struct response<t_param, dummy_error>
76 {
77 std::string jsonrpc;
78 t_param result;
80
81 response(): result{}, id{} {}
82
84 KV_SERIALIZE(jsonrpc)
85 KV_SERIALIZE(id)
88 };
89
90 template<typename t_error>
91 struct response<dummy_result, t_error>
92 {
93 std::string jsonrpc;
94 t_error error;
96
97 response(): error{}, id{} {}
98
100 KV_SERIALIZE(jsonrpc)
101 KV_SERIALIZE(id)
104 };
105
107 }
108}
109
110#endif /* JSONRPC_STRUCTS_H */
#define KV_SERIALIZE(varialble)
Definition: keyvalue_serialization.h:118
#define END_KV_SERIALIZE_MAP()
Definition: keyvalue_serialization.h:116
#define BEGIN_KV_SERIALIZE_MAP()
Definition: keyvalue_serialization.h:43
boost::variant< uint64_t, uint32_t, uint16_t, uint8_t, int64_t, int32_t, int16_t, int8_t, double, bool, std::string, section, array_entry > storage_entry
Definition: portable_storage_base.h:161
TODO: (mj-xmr) This will be reduced in an another PR.
Definition: byte_slice.h:40
enum upnpconfigoptions id
Definition: options.c:29
const portMappingElt code
Definition: portlistingparse.c:22
tools::wallet2::message_signature_result_t result
Definition: signature.cpp:62
signed __int64 int64_t
Definition: stdint.h:135
Definition: jsonrpc_structs.h:45
Definition: jsonrpc_structs.h:51
Definition: jsonrpc_structs.h:32
int64_t code
Definition: jsonrpc_structs.h:33
std::string message
Definition: jsonrpc_structs.h:34
error()
Definition: jsonrpc_structs.h:36
Definition: jsonrpc_structs.h:15
request()
Definition: jsonrpc_structs.h:21
std::string method
Definition: jsonrpc_structs.h:17
epee::serialization::storage_entry id
Definition: jsonrpc_structs.h:18
std::string jsonrpc
Definition: jsonrpc_structs.h:16
t_param params
Definition: jsonrpc_structs.h:19
std::string jsonrpc
Definition: jsonrpc_structs.h:93
response()
Definition: jsonrpc_structs.h:97
t_error error
Definition: jsonrpc_structs.h:94
epee::serialization::storage_entry id
Definition: jsonrpc_structs.h:95
epee::serialization::storage_entry id
Definition: jsonrpc_structs.h:79
response()
Definition: jsonrpc_structs.h:81
t_param result
Definition: jsonrpc_structs.h:78
std::string jsonrpc
Definition: jsonrpc_structs.h:77
Definition: jsonrpc_structs.h:58
response()
Definition: jsonrpc_structs.h:64
epee::serialization::storage_entry id
Definition: jsonrpc_structs.h:61
t_param result
Definition: jsonrpc_structs.h:60
t_error error
Definition: jsonrpc_structs.h:62
std::string jsonrpc
Definition: jsonrpc_structs.h:59