1#include "mtx/responses/register.hpp"
2
3#include <nlohmann/json.hpp>
4
5using json = nlohmann::json;
6
7namespace mtx {
8namespace responses {
9
10void
11from_json(const json &obj, Register &response)
12{
13 using namespace mtx::identifiers;
14 response.user_id = obj.at(key: "user_id").get<User>();
15 response.access_token = obj.at(key: "access_token").get<std::string>();
16 response.device_id = obj.at(key: "device_id").get<std::string>();
17}
18
19void
20from_json(const nlohmann::json &obj, RegistrationTokenValidity &response)
21{
22 response.valid = obj.at(key: "valid").get<bool>();
23}
24}
25}
26