libkazv
location.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 ThirdPartyLocation
13 {
14 
16  std::string alias;
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<ThirdPartyLocation> {
32  static void to_json(json& jo, const ThirdPartyLocation &pod)
33  {
34  if (! jo.is_object()) { jo = json::object(); }
35 
36 
37  jo["alias"s] = pod.alias;
38 
39  jo["protocol"s] = pod.protocol;
40 
41  jo["fields"s] = pod.fields;
42 
43  }
44  static void from_json(const json &jo, ThirdPartyLocation& result)
45  {
46 
47  if (jo.contains("alias"s)) {
48  result.alias = jo.at("alias"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< ThirdPartyLocation >::from_json
static void from_json(const json &jo, ThirdPartyLocation &result)
Definition: location.hpp:44
types.hpp
Kazv::Api::ThirdPartyLocation::alias
std::string alias
An alias for a matrix room.
Definition: location.hpp:20
nlohmann
Definition: location.hpp:26
Kazv
Definition: location.hpp:10
Kazv::Api::ThirdPartyLocation::protocol
std::string protocol
The protocol ID that the third party location is a part of.
Definition: location.hpp:23
Kazv::json
nlohmann::json json
Definition: jsonwrap.hpp:20
Kazv::Api
Definition: location.hpp:10
Kazv::JsonWrap
Definition: jsonwrap.hpp:22
Kazv::Api::ThirdPartyLocation
Definition: location.hpp:14
Kazv::Api::ThirdPartyLocation::fields
JsonWrap fields
Information used to identify this third party location.
Definition: location.hpp:26
nlohmann::adl_serializer< ThirdPartyLocation >::to_json
static void to_json(json &jo, const ThirdPartyLocation &pod)
Definition: location.hpp:32