libkazv
Loading...
Searching...
No Matches
tags.hpp
Go to the documentation of this file.
1/******************************************************************************
2 * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
3 */
4
5#pragma once
6
7#include "basejob.hpp"
8
9
10namespace Kazv::Api {
11
16class GetRoomTagsJob : public BaseJob {
17public:
18 // Inner data structures
19
21 struct Tag
22 {
25 std::optional<float> order;
28 };
29
30
31
32class JobResponse : public Response
33{
34
35public:
37 bool success() const;
38
39 // Result properties
40
41
42
43
45immer::map<std::string, Tag> tags() const;
46
47};
48 static constexpr auto needsAuth() {
49 return true
50 ;
51 }
52
53
54// Construction/destruction
55
65 explicit GetRoomTagsJob(std::string serverUrl
66 , std::string _accessToken
67 ,
68 std::string userId , std::string roomId
69 );
70
71
73 );
74
75 static BaseJob::Body buildBody(std::string userId, std::string roomId);
76
77
78
79
80
83 };
85 }
86 namespace nlohmann
87 {
88 using namespace Kazv;
89 using namespace Kazv::Api;
90 template<>
91 struct adl_serializer<GetRoomTagsJob::Tag> {
92
93 static void to_json(json& jo, const GetRoomTagsJob::Tag &pod)
94 {
95 if (! jo.is_object()) { jo = json::object(); }
96
98
99 addToJsonIfNeeded(jo, "order"s, pod.order);
100 }
101
102 static void from_json(const json &jo, GetRoomTagsJob::Tag& result)
103 {
104
105 if (jo.contains("order"s)) {
106 result.order = jo.at("order"s);
107 }
108 result.additionalProperties = jo;
109 }
110
111};
112 }
113
114 namespace Kazv::Api
115 {
116
121class SetRoomTagJob : public BaseJob {
122public:
123
124
125
126class JobResponse : public Response
127{
128
129public:
131 bool success() const;
132
133};
134 static constexpr auto needsAuth() {
135 return true
136 ;
137 }
138
139
140// Construction/destruction
141
161 explicit SetRoomTagJob(std::string serverUrl
162 , std::string _accessToken
163 ,
164 std::string userId , std::string roomId , std::string tag , std::optional<float> order = std::nullopt, JsonWrap additionalProperties = {}
165 );
166
167
169 );
170
171 static BaseJob::Body buildBody(std::string userId, std::string roomId, std::string tag, std::optional<float> order, JsonWrap additionalProperties);
172
173
174
175
176
179 };
181 }
182 namespace nlohmann
183 {
184 using namespace Kazv;
185 using namespace Kazv::Api;
186
187 }
188
189 namespace Kazv::Api
190 {
191
196class DeleteRoomTagJob : public BaseJob {
197public:
198
199
200
201class JobResponse : public Response
202{
203
204public:
206 bool success() const;
207
208};
209 static constexpr auto needsAuth() {
210 return true
211 ;
212 }
213
214
215// Construction/destruction
216
229 explicit DeleteRoomTagJob(std::string serverUrl
230 , std::string _accessToken
231 ,
232 std::string userId , std::string roomId , std::string tag
233 );
234
235
237 );
238
239 static BaseJob::Body buildBody(std::string userId, std::string roomId, std::string tag);
240
241
242
243
244
247 };
249 }
250 namespace nlohmann
251 {
252 using namespace Kazv;
253 using namespace Kazv::Api;
254
255 }
256
257 namespace Kazv::Api
258 {
259
260} // namespace Kazv::Api
bool success() const
Definition tags.cpp:223
Remove a tag from the room.
Definition tags.hpp:196
static BaseJob::Query buildQuery()
Definition tags.cpp:166
static BaseJob::Body buildBody(std::string userId, std::string roomId, std::string tag)
Definition tags.cpp:174
static constexpr auto needsAuth()
Definition tags.hpp:209
DeleteRoomTagJob withData(JsonWrap j) &&
Definition tags.cpp:206
immer::map< std::string, Tag > tags() const
List the tags set by a user on a room.
Definition tags.cpp:80
bool success() const
Definition tags.cpp:70
List the tags for a room.
Definition tags.hpp:16
static BaseJob::Body buildBody(std::string userId, std::string roomId)
Definition tags.cpp:21
static BaseJob::Query buildQuery()
Definition tags.cpp:13
static constexpr auto needsAuth()
Definition tags.hpp:48
GetRoomTagsJob withData(JsonWrap j) &&
Definition tags.cpp:53
bool success() const
Definition tags.cpp:155
Add a tag to a room.
Definition tags.hpp:121
SetRoomTagJob withData(JsonWrap j) &&
Definition tags.cpp:138
static constexpr auto needsAuth()
Definition tags.hpp:134
static BaseJob::Body buildBody(std::string userId, std::string roomId, std::string tag, std::optional< float > order, JsonWrap additionalProperties)
Definition tags.cpp:100
static BaseJob::Query buildQuery()
Definition tags.cpp:92
Definition basejob.hpp:94
Definition basejob.hpp:68
::Kazv::Body Body
Definition basejob.hpp:103
Definition jsonwrap.hpp:23
Definition location.hpp:10
Definition location.hpp:10
void addToJsonIfNeeded(json &j, std::string name, T &&arg)
Definition types.hpp:80
void addPropertyMapToJson(json &j, MapT &&arg)
Definition types.hpp:91
nlohmann::json json
Definition jsonwrap.hpp:20
Definition location.hpp:27
List the tags set by a user on a room.
Definition tags.hpp:22
JsonWrap additionalProperties
List the tags set by a user on a room.
Definition tags.hpp:27
std::optional< float > order
A number in a range [0,1] describing a relative position of the room under the given tag.
Definition tags.hpp:25
Definition basejob.hpp:49
static void to_json(json &jo, const GetRoomTagsJob::Tag &pod)
Definition tags.hpp:93
static void from_json(const json &jo, GetRoomTagsJob::Tag &result)
Definition tags.hpp:102