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 {
14 struct DiscoveryInformation
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 
40  addPropertyMapToJson(jo, pod.additionalProperties);
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
nlohmann::adl_serializer< DiscoveryInformation >::from_json
static void from_json(const json &jo, DiscoveryInformation &result)
Definition: full.hpp:46
Kazv::Api::DiscoveryInformation::homeserver
HomeserverInformation homeserver
Used by clients to determine the homeserver, identity server, and other optional components they shou...
Definition: full.hpp:23
types.hpp
Kazv::Api::HomeserverInformation
Used by clients to discover homeserver information.
Definition: homeserver.hpp:14
nlohmann
Definition: location.hpp:26
Kazv
Definition: location.hpp:10
Kazv::addPropertyMapToJson
void addPropertyMapToJson(json &j, MapT &&arg)
Definition: types.hpp:91
Kazv::json
nlohmann::json json
Definition: jsonwrap.hpp:20
Kazv::Api
Definition: location.hpp:10
identity_server.hpp
Kazv::addToJsonIfNeeded
void addToJsonIfNeeded(json &j, std::string name, T &&arg)
Definition: types.hpp:80
Kazv::Api::DiscoveryInformation::additionalProperties
immer::map< std::string, JsonWrap > additionalProperties
Application-dependent keys using Java package naming convention.
Definition: full.hpp:30
nlohmann::adl_serializer< DiscoveryInformation >::to_json
static void to_json(json &jo, const DiscoveryInformation &pod)
Definition: full.hpp:36
Kazv::Api::DiscoveryInformation
Used by clients to determine the homeserver, identity server, and other optional components they shou...
Definition: full.hpp:16
homeserver.hpp
Kazv::Api::DiscoveryInformation::identityServer
std::optional< IdentityServerInformation > identityServer
Used by clients to determine the homeserver, identity server, and other optional components they shou...
Definition: full.hpp:27