libkazv
full.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"
10 
11 namespace Kazv::Api {
15 {
16 
20 
23  std::optional<IdentityServerInformation> identityServer;
24 
26  immer::map<std::string, JsonWrap> additionalProperties;
27 };
28 
29 }
30 namespace nlohmann
31 {
32 using namespace Kazv;
33 using namespace Kazv::Api;
34 template<>
35 struct adl_serializer<DiscoveryInformation> {
36  static void to_json(json& jo, const DiscoveryInformation &pod)
37  {
38  if (! jo.is_object()) { jo = json::object(); }
39 
41  jo["m.homeserver"s] = pod.homeserver;
42 
43 
44  addToJsonIfNeeded(jo, "m.identity_server"s, pod.identityServer);
45  }
46  static void from_json(const json &jo, DiscoveryInformation& result)
47  {
48 
49  if (jo.contains("m.homeserver"s)) {
50  result.homeserver = jo.at("m.homeserver"s);
51  }
52  if (jo.contains("m.identity_server"s)) {
53  result.identityServer = jo.at("m.identity_server"s);
54  }
55  result.additionalProperties = jo;
56  }
57 };
58  }
59 
60  namespace Kazv::Api
61  {
62 } // namespace Kazv::Api
Definition: location.hpp:10
Definition: location.hpp:10
void addToJsonIfNeeded(json &j, std::string name, T &&arg)
Definition: types.hpp:80
void addPropertyMapToJson(json &j, MapT &&arg)
Definition: types.hpp:91
nlohmann::json json
Definition: jsonwrap.hpp:20
Definition: location.hpp:27
Used by clients to determine the homeserver, identity server, and other optional components they shou...
Definition: full.hpp:15
immer::map< std::string, JsonWrap > additionalProperties
Application-dependent keys using Java package naming convention.
Definition: full.hpp:26
std::optional< IdentityServerInformation > identityServer
Used by clients to determine the homeserver, identity server, and other optional components they shou...
Definition: full.hpp:23
HomeserverInformation homeserver
Used by clients to determine the homeserver, identity server, and other optional components they shou...
Definition: full.hpp:19
Used by clients to discover homeserver information.
Definition: homeserver.hpp:13
static void from_json(const json &jo, DiscoveryInformation &result)
Definition: full.hpp:46
static void to_json(json &jo, const DiscoveryInformation &pod)
Definition: full.hpp:36