libkazv
third_party_lookup.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"
11 
12 namespace Kazv::Api {
13 
20 class GetProtocolsJob : public BaseJob {
21 public:
22 
23 
24 
25 class JobResponse : public Response
26 {
27 
28 public:
30  bool success() const;
31 
32  // Result properties
33 
34 
36 
37  immer::map<std::string, ThirdPartyProtocol> data() const
38  {
39  return
40  std::move(jsonBody().get()).get<immer::map<std::string, ThirdPartyProtocol>>()
41  ;
42  }
43 
44 
45 };
46  static constexpr auto needsAuth() {
47  return true
48  ;
49  }
50 
51 
52 // Construction/destruction
53 
55  explicit GetProtocolsJob(std::string serverUrl
56  , std::string _accessToken
57 
58 
59  );
60 
61 
63  );
64 
65  static BaseJob::Body buildBody();
66 
67 
68 
69 
70 
73  };
75  }
76  namespace nlohmann
77  {
78  using namespace Kazv;
79  using namespace Kazv::Api;
80 
81  }
82 
83  namespace Kazv::Api
84  {
85 
91 public:
92 
93 
94 
95 class JobResponse : public Response
96 {
97 
98 public:
100  bool success() const;
101 
102  // Result properties
103 
104 
106 
108  {
109  return
110  std::move(jsonBody().get()).get<ThirdPartyProtocol>()
111  ;
112  }
113 
114 
115 };
116  static constexpr auto needsAuth() {
117  return true
118  ;
119  }
120 
121 
122 // Construction/destruction
123 
129  explicit GetProtocolMetadataJob(std::string serverUrl
130  , std::string _accessToken
131  ,
132  std::string protocol
133  );
134 
135 
136  static BaseJob::Query buildQuery(
137  );
138 
139  static BaseJob::Body buildBody(std::string protocol);
140 
141 
142 
143 
144 
145  GetProtocolMetadataJob withData(JsonWrap j) &&;
146  GetProtocolMetadataJob withData(JsonWrap j) const &;
147  };
149  }
150  namespace nlohmann
151  {
152  using namespace Kazv;
153  using namespace Kazv::Api;
154 
155  }
156 
157  namespace Kazv::Api
158  {
159 
172 public:
173 
174 
175 
176 class JobResponse : public Response
177 {
178 
179 public:
181  bool success() const;
182 
183  // Result properties
184 
185 
187 
188  immer::array<ThirdPartyLocation> data() const
189  {
190  return
191  std::move(jsonBody().get()).get<immer::array<ThirdPartyLocation>>()
192  ;
193  }
194 
195 
196 };
197  static constexpr auto needsAuth() {
198  return true
199  ;
200  }
201 
202 
203 // Construction/destruction
204 
214  explicit QueryLocationByProtocolJob(std::string serverUrl
215  , std::string _accessToken
216  ,
217  std::string protocol , std::optional<std::string> searchFields = std::nullopt
218  );
219 
220 
221  static BaseJob::Query buildQuery(
222  std::optional<std::string> searchFields);
223 
224  static BaseJob::Body buildBody(std::string protocol, std::optional<std::string> searchFields);
225 
226 
227 
228 
229 
230  QueryLocationByProtocolJob withData(JsonWrap j) &&;
231  QueryLocationByProtocolJob withData(JsonWrap j) const &;
232  };
234  }
235  namespace nlohmann
236  {
237  using namespace Kazv;
238  using namespace Kazv::Api;
239 
240  }
241 
242  namespace Kazv::Api
243  {
244 
251 public:
252 
253 
254 
255 class JobResponse : public Response
256 {
257 
258 public:
260  bool success() const;
261 
262  // Result properties
263 
264 
266 
267  immer::array<ThirdPartyUser> data() const
268  {
269  return
270  std::move(jsonBody().get()).get<immer::array<ThirdPartyUser>>()
271  ;
272  }
273 
274 
275 };
276  static constexpr auto needsAuth() {
277  return true
278  ;
279  }
280 
281 
282 // Construction/destruction
283 
292  explicit QueryUserByProtocolJob(std::string serverUrl
293  , std::string _accessToken
294  ,
295  std::string protocol , std::optional<std::string> fields = std::nullopt
296  );
297 
298 
299  static BaseJob::Query buildQuery(
300  std::optional<std::string> fields);
301 
302  static BaseJob::Body buildBody(std::string protocol, std::optional<std::string> fields);
303 
304 
305 
306 
307 
308  QueryUserByProtocolJob withData(JsonWrap j) &&;
309  QueryUserByProtocolJob withData(JsonWrap j) const &;
310  };
312  }
313  namespace nlohmann
314  {
315  using namespace Kazv;
316  using namespace Kazv::Api;
317 
318  }
319 
320  namespace Kazv::Api
321  {
322 
329 public:
330 
331 
332 
333 class JobResponse : public Response
334 {
335 
336 public:
338  bool success() const;
339 
340  // Result properties
341 
342 
344 
345  immer::array<ThirdPartyLocation> data() const
346  {
347  return
348  std::move(jsonBody().get()).get<immer::array<ThirdPartyLocation>>()
349  ;
350  }
351 
352 
353 };
354  static constexpr auto needsAuth() {
355  return true
356  ;
357  }
358 
359 
360 // Construction/destruction
361 
367  explicit QueryLocationByAliasJob(std::string serverUrl
368  , std::string _accessToken
369  ,
370  std::string alias
371  );
372 
373 
374  static BaseJob::Query buildQuery(
375  std::string alias);
376 
377  static BaseJob::Body buildBody(std::string alias);
378 
379 
380 
381 
382 
383  QueryLocationByAliasJob withData(JsonWrap j) &&;
384  QueryLocationByAliasJob withData(JsonWrap j) const &;
385  };
387  }
388  namespace nlohmann
389  {
390  using namespace Kazv;
391  using namespace Kazv::Api;
392 
393  }
394 
395  namespace Kazv::Api
396  {
397 
402 class QueryUserByIDJob : public BaseJob {
403 public:
404 
405 
406 
407 class JobResponse : public Response
408 {
409 
410 public:
412  bool success() const;
413 
414  // Result properties
415 
416 
418 
419  immer::array<ThirdPartyUser> data() const
420  {
421  return
422  std::move(jsonBody().get()).get<immer::array<ThirdPartyUser>>()
423  ;
424  }
425 
426 
427 };
428  static constexpr auto needsAuth() {
429  return true
430  ;
431  }
432 
433 
434 // Construction/destruction
435 
441  explicit QueryUserByIDJob(std::string serverUrl
442  , std::string _accessToken
443  ,
444  std::string userid
445  );
446 
447 
448  static BaseJob::Query buildQuery(
449  std::string userid);
450 
451  static BaseJob::Body buildBody(std::string userid);
452 
453 
454 
455 
456 
457  QueryUserByIDJob withData(JsonWrap j) &&;
458  QueryUserByIDJob withData(JsonWrap j) const &;
459  };
461  }
462  namespace nlohmann
463  {
464  using namespace Kazv;
465  using namespace Kazv::Api;
466 
467  }
468 
469  namespace Kazv::Api
470  {
471 
472 } // namespace Kazv::Api
Kazv::Api::GetProtocolsJob::buildBody
static BaseJob::Body buildBody()
Definition: third_party_lookup.cpp:23
Kazv::Response::jsonBody
JsonWrap jsonBody() const
Definition: basejob.cpp:139
Kazv::Api::GetProtocolsJob::JobResponse
Definition: third_party_lookup.hpp:29
Kazv::Api::QueryLocationByProtocolJob::JobResponse
Definition: third_party_lookup.hpp:176
nlohmann
Definition: location.hpp:26
Kazv::Api::QueryUserByProtocolJob::JobResponse
Definition: third_party_lookup.hpp:255
Kazv::Api::GetProtocolMetadataJob
Retrieve metadata about a specific protocol that the homeserver supports.
Definition: third_party_lookup.hpp:90
Kazv::Api::QueryLocationByAliasJob::needsAuth
static constexpr auto needsAuth()
Definition: third_party_lookup.hpp:354
Kazv
Definition: location.hpp:10
Kazv::BaseJob::Query
Definition: basejob.hpp:90
Kazv::Api::QueryLocationByAliasJob::JobResponse::data
immer::array< ThirdPartyLocation > data() const
All found third party locations.
Definition: third_party_lookup.hpp:345
Kazv::Api::QueryUserByProtocolJob
Retrieve the Matrix User ID of a corresponding third party user.
Definition: third_party_lookup.hpp:250
Kazv::Api::QueryUserByProtocolJob::JobResponse::data
immer::array< ThirdPartyUser > data() const
The Matrix User IDs found with the given parameters.
Definition: third_party_lookup.hpp:267
user.hpp
Kazv::Api::GetProtocolsJob::JobResponse::data
immer::map< std::string, ThirdPartyProtocol > data() const
The protocols supported by the homeserver.
Definition: third_party_lookup.hpp:43
Kazv::Api
Definition: location.hpp:10
Kazv::Api::QueryUserByProtocolJob::needsAuth
static constexpr auto needsAuth()
Definition: third_party_lookup.hpp:276
Kazv::Api::QueryUserByIDJob::JobResponse
Definition: third_party_lookup.hpp:407
Kazv::Api::GetProtocolMetadataJob::JobResponse::data
ThirdPartyProtocol data() const
The protocol was found and metadata returned.
Definition: third_party_lookup.hpp:107
Kazv::Api::ThirdPartyProtocol
Definition: protocol.hpp:119
Kazv::Api::GetProtocolsJob::buildQuery
static BaseJob::Query buildQuery()
Definition: third_party_lookup.cpp:15
basejob.hpp
location.hpp
Kazv::Api::GetProtocolMetadataJob::needsAuth
static constexpr auto needsAuth()
Definition: third_party_lookup.hpp:116
Kazv::JsonWrap
Definition: jsonwrap.hpp:22
Kazv::Api::GetProtocolsJob::JobResponse::JobResponse
JobResponse(Response r)
Definition: third_party_lookup.cpp:69
Kazv::Api::QueryLocationByAliasJob::JobResponse
Definition: third_party_lookup.hpp:333
Kazv::Api::GetProtocolsJob
Retrieve metadata about all protocols that a homeserver supports.
Definition: third_party_lookup.hpp:22
Kazv::BaseJob
Definition: basejob.hpp:76
Kazv::Api::GetProtocolMetadataJob::JobResponse
Definition: third_party_lookup.hpp:95
protocol.hpp
Kazv::Api::QueryUserByIDJob::needsAuth
static constexpr auto needsAuth()
Definition: third_party_lookup.hpp:428
Kazv::Api::QueryUserByIDJob::JobResponse::data
immer::array< ThirdPartyUser > data() const
An array of third party users.
Definition: third_party_lookup.hpp:419
Kazv::Api::GetProtocolsJob::GetProtocolsJob
GetProtocolsJob(std::string serverUrl, std::string _accessToken)
Retrieve metadata about all protocols that a homeserver supports.
Definition: third_party_lookup.cpp:35
Kazv::BaseJob::Body
::Kazv::Body Body
Definition: basejob.hpp:100
Kazv::Api::QueryLocationByAliasJob
Reverse-lookup third party locations given a Matrix room alias.
Definition: third_party_lookup.hpp:328
Kazv::Api::QueryUserByIDJob
Reverse-lookup third party users given a Matrix User ID.
Definition: third_party_lookup.hpp:402
Kazv::Api::QueryLocationByProtocolJob::JobResponse::data
immer::array< ThirdPartyLocation > data() const
At least one portal room was found.
Definition: third_party_lookup.hpp:188
Kazv::Api::QueryLocationByProtocolJob::needsAuth
static constexpr auto needsAuth()
Definition: third_party_lookup.hpp:197
Kazv::Api::GetProtocolsJob::JobResponse::success
bool success() const
Definition: third_party_lookup.cpp:72
Kazv::Api::QueryLocationByProtocolJob
Retrieve Matrix-side portals rooms leading to a third party location.
Definition: third_party_lookup.hpp:171
Kazv::Response
Definition: basejob.hpp:50
Kazv::Api::GetProtocolsJob::needsAuth
static constexpr auto needsAuth()
Definition: third_party_lookup.hpp:50
Kazv::Api::GetProtocolsJob::withData
GetProtocolsJob withData(JsonWrap j) &&
Definition: third_party_lookup.cpp:55