32 std::optional<std::string>
ip;
79 std::optional<std::string>
userId()
const;
83 immer::map<std::string, DeviceInfo>
devices()
const;
100 , std::string _accessToken
122 using namespace Kazv;
129 if (! jo.is_object()) { jo = json::object(); }
143 if (jo.contains(
"ip"s)) {
144 result.
ip = jo.at(
"ip"s);
146 if (jo.contains(
"last_seen"s)) {
147 result.
lastSeen = jo.at(
"last_seen"s);
149 if (jo.contains(
"user_agent"s)) {
161 if (! jo.is_object()) { jo = json::object(); }
171 if (jo.contains(
"connections"s)) {
183 if (! jo.is_object()) { jo = json::object(); }
193 if (jo.contains(
"sessions"s)) {
194 result.
sessions = jo.at(
"sessions"s);
std::optional< std::string > userId() const
The Matrix user ID of the user.
Definition: admin.cpp:80
bool success() const
Definition: admin.cpp:70
JobResponse(Response r)
Definition: admin.cpp:67
immer::map< std::string, DeviceInfo > devices() const
Each key is an identifier for one of the user's devices.
Definition: admin.cpp:91
Gets information about a particular user.
Definition: admin.hpp:20
static BaseJob::Body buildBody(std::string userId)
Definition: admin.cpp:21
static constexpr auto needsAuth()
Definition: admin.hpp:86
static BaseJob::Query buildQuery()
Definition: admin.cpp:13
GetWhoIsJob(std::string serverUrl, std::string _accessToken, std::string userId)
Gets information about a particular user.
Definition: admin.cpp:33
GetWhoIsJob withData(JsonWrap j) &&
Definition: admin.cpp:53
Definition: basejob.hpp:91
Definition: basejob.hpp:77
::Kazv::Body Body
Definition: basejob.hpp:100
Definition: jsonwrap.hpp:23
Definition: location.hpp:10
Definition: location.hpp:10
void addToJsonIfNeeded(json &j, std::string name, T &&arg)
Definition: types.hpp:80
nlohmann::json json
Definition: jsonwrap.hpp:20
Definition: location.hpp:27
Gets information about a particular user.
Definition: admin.hpp:30
std::optional< std::int_fast64_t > lastSeen
Unix timestamp that the session was last active.
Definition: admin.hpp:34
std::optional< std::string > ip
Most recently seen IP address of the session.
Definition: admin.hpp:32
std::optional< std::string > userAgent
User agent string last seen in the session.
Definition: admin.hpp:36
Gets information about a particular user.
Definition: admin.hpp:58
immer::array< SessionInfo > sessions
A user's sessions (i.e. what they did with an access token from one login).
Definition: admin.hpp:60
Gets information about a particular user.
Definition: admin.hpp:46
immer::array< ConnectionInfo > connections
Information particular connections in the session.
Definition: admin.hpp:48
Definition: basejob.hpp:50
static void from_json(const json &jo, GetWhoIsJob::ConnectionInfo &result)
Definition: admin.hpp:140
static void to_json(json &jo, const GetWhoIsJob::ConnectionInfo &pod)
Definition: admin.hpp:127
static void to_json(json &jo, const GetWhoIsJob::DeviceInfo &pod)
Definition: admin.hpp:181
static void from_json(const json &jo, GetWhoIsJob::DeviceInfo &result)
Definition: admin.hpp:190
static void to_json(json &jo, const GetWhoIsJob::SessionInfo &pod)
Definition: admin.hpp:159
static void from_json(const json &jo, GetWhoIsJob::SessionInfo &result)
Definition: admin.hpp:168