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 
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
Definition: jsonwrap.hpp:23
Definition: location.hpp:10
Definition: location.hpp:10
nlohmann::json json
Definition: jsonwrap.hpp:20
Definition: location.hpp:27
Definition: location.hpp:13
std::string protocol
The protocol ID that the third party location is a part of.
Definition: location.hpp:19
JsonWrap fields
Information used to identify this third party location.
Definition: location.hpp:22
std::string alias
An alias for a matrix room.
Definition: location.hpp:16
static void to_json(json &jo, const ThirdPartyLocation &pod)
Definition: location.hpp:32
static void from_json(const json &jo, ThirdPartyLocation &result)
Definition: location.hpp:44