Page MenuHomePhorge

auth_data.hpp
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

auth_data.hpp

/******************************************************************************
* THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
*/
#pragma once
#include "types.hpp"
namespace Kazv::Api {
/// Used by clients to submit authentication information to the interactive-authentication API
struct AuthenticationData
{
/// The login type that the client is attempting to complete.
std::string type;
/// The value of the session key given by the homeserver.
std::optional<std::string> session;
/// Keys dependent on the login type
immer::map<std::string, JsonWrap> authInfo;
};
}
namespace nlohmann
{
using namespace Kazv;
using namespace Kazv::Api;
template<>
struct adl_serializer<AuthenticationData> {
static void to_json(json& jo, const AuthenticationData &pod)
{
if (! jo.is_object()) { jo = json::object(); }
addPropertyMapToJson(jo, pod.authInfo);
jo["type"s] = pod.type;
addToJsonIfNeeded(jo, "session"s, pod.session);
}
static void from_json(const json &jo, AuthenticationData& result)
{
if (jo.contains("type"s)) {
result.type = jo.at("type"s);
}
if (jo.contains("session"s)) {
result.session = jo.at("session"s);
}
result.authInfo = jo;
}
};
}
namespace Kazv::Api
{
} // namespace Kazv::Api

File Metadata

Mime Type
text/x-c++
Expires
Thu, Oct 2, 2:24 AM (1 d, 1 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
478920
Default Alt Text
auth_data.hpp (1 KB)

Event Timeline