libkazv
user.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 "types.hpp"
8 
9 
10 namespace Kazv::Api {
11 
13 {
14 
16  std::string userid;
17 
19  std::string protocol;
20 
23 };
24 
25 }
26 namespace nlohmann
27 {
28 using namespace Kazv;
29 using namespace Kazv::Api;
30 template<>
31 struct adl_serializer<ThirdPartyUser> {
32  static void to_json(json& jo, const ThirdPartyUser &pod)
33  {
34  if (! jo.is_object()) { jo = json::object(); }
35 
36 
37  jo["userid"s] = pod.userid;
38 
39  jo["protocol"s] = pod.protocol;
40 
41  jo["fields"s] = pod.fields;
42 
43  }
44  static void from_json(const json &jo, ThirdPartyUser& result)
45  {
46 
47  if (jo.contains("userid"s)) {
48  result.userid = jo.at("userid"s);
49  }
50  if (jo.contains("protocol"s)) {
51  result.protocol = jo.at("protocol"s);
52  }
53  if (jo.contains("fields"s)) {
54  result.fields = jo.at("fields"s);
55  }
56 
57  }
58 };
59  }
60 
61  namespace Kazv::Api
62  {
63 } // namespace Kazv::Api
Definition: jsonwrap.hpp:23
Definition: location.hpp:10
Definition: location.hpp:10
nlohmann::json json
Definition: jsonwrap.hpp:20
Definition: location.hpp:27
Definition: user.hpp:13
JsonWrap fields
Information used to identify this third party location.
Definition: user.hpp:22
std::string protocol
The protocol ID that the third party location is a part of.
Definition: user.hpp:19
std::string userid
A Matrix User ID represting a third party user.
Definition: user.hpp:16
static void from_json(const json &jo, ThirdPartyUser &result)
Definition: user.hpp:44
static void to_json(json &jo, const ThirdPartyUser &pod)
Definition: user.hpp:32