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 
12 struct ThirdPartyUser
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
nlohmann::adl_serializer< ThirdPartyUser >::from_json
static void from_json(const json &jo, ThirdPartyUser &result)
Definition: user.hpp:44
Kazv::Api::ThirdPartyUser
Definition: user.hpp:14
types.hpp
nlohmann
Definition: location.hpp:26
Kazv::Api::ThirdPartyUser::protocol
std::string protocol
The protocol ID that the third party location is a part of.
Definition: user.hpp:23
Kazv::Api::ThirdPartyUser::fields
JsonWrap fields
Information used to identify this third party location.
Definition: user.hpp:26
Kazv
Definition: location.hpp:10
Kazv::json
nlohmann::json json
Definition: jsonwrap.hpp:20
Kazv::Api
Definition: location.hpp:10
Kazv::Api::ThirdPartyUser::userid
std::string userid
A Matrix User ID represting a third party user.
Definition: user.hpp:20
Kazv::JsonWrap
Definition: jsonwrap.hpp:22
nlohmann::adl_serializer< ThirdPartyUser >::to_json
static void to_json(json &jo, const ThirdPartyUser &pod)
Definition: user.hpp:32