35 if (! jo.is_object()) { jo = json::object(); }
38 jo[
"events"s] = pod.
events;
48 if (jo.contains(
"events"s)) {
49 result.
events = jo.at(
"events"s);
51 if (jo.contains(
"limited"s)) {
52 result.
limited = jo.at(
"limited"s);
54 if (jo.contains(
"prev_batch"s)) {
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
immer::flex_vector< Event > EventList
Definition: types.hpp:107
Definition: location.hpp:27
Definition: timeline_batch.hpp:13
std::optional< bool > limited
True if the number of events returned was limited by the limit on the filter.
Definition: timeline_batch.hpp:19
std::optional< std::string > prevBatch
A token that can be supplied to the from parameter of the /rooms/<room_id>/messages endpoint in order...
Definition: timeline_batch.hpp:23
EventList events
List of events.
Definition: timeline_batch.hpp:16
static void to_json(json &jo, const Timeline &pod)
Definition: timeline_batch.hpp:33
static void from_json(const json &jo, Timeline &result)
Definition: timeline_batch.hpp:45