68 std::optional<std::string>
name;
70 std::optional<std::string>
topic;
96 immer::array<ChildRoomsChunk>
rooms()
const;
101 std::optional<std::string>
nextBatch()
const;
140 , std::string _accessToken
142 std::string roomId , std::optional<bool> suggestedOnly = std::nullopt, std::optional<int> limit = std::nullopt, std::optional<int> maxDepth = std::nullopt, std::optional<std::string> from = std::nullopt
147 std::optional<bool> suggestedOnly, std::optional<int> limit, std::optional<int> maxDepth, std::optional<std::string> from);
149 static BaseJob::Body buildBody(std::string roomId, std::optional<bool> suggestedOnly, std::optional<int> limit, std::optional<int> maxDepth, std::optional<std::string> from);
162 using namespace Kazv;
169 if (! jo.is_object()) { jo = json::object(); }
170 jo =
static_cast<const Event &
>(pod);
179 static_cast<Event &
>(result) = jo;
181 if (jo.contains(
"origin_server_ts"s)) {
193 if (! jo.is_object()) { jo = json::object(); }
198 jo[
"room_id"s] = pod.
roomId;
223 if (jo.contains(
"num_joined_members"s)) {
226 if (jo.contains(
"room_id"s)) {
227 result.
roomId = jo.at(
"room_id"s);
229 if (jo.contains(
"world_readable"s)) {
232 if (jo.contains(
"guest_can_join"s)) {
235 if (jo.contains(
"children_state"s)) {
238 if (jo.contains(
"canonical_alias"s)) {
241 if (jo.contains(
"name"s)) {
242 result.
name = jo.at(
"name"s);
244 if (jo.contains(
"topic"s)) {
245 result.
topic = jo.at(
"topic"s);
247 if (jo.contains(
"avatar_url"s)) {
250 if (jo.contains(
"join_rule"s)) {
251 result.
joinRule = jo.at(
"join_rule"s);
253 if (jo.contains(
"room_type"s)) {
254 result.
roomType = jo.at(
"room_type"s);
Definition: space_hierarchy.hpp:84
bool success() const
Definition: space_hierarchy.cpp:77
JobResponse(Response r)
Definition: space_hierarchy.cpp:74
immer::array< ChildRoomsChunk > rooms() const
The rooms for the current page, with the current filters.
Definition: space_hierarchy.cpp:88
std::optional< std::string > nextBatch() const
A token to supply to from to keep paginating the responses.
Definition: space_hierarchy.cpp:99
Retrieve a portion of a space tree.
Definition: space_hierarchy.hpp:22
static BaseJob::Body buildBody(std::string roomId, std::optional< bool > suggestedOnly, std::optional< int > limit, std::optional< int > maxDepth, std::optional< std::string > from)
Definition: space_hierarchy.cpp:28
static BaseJob::Query buildQuery(std::optional< bool > suggestedOnly, std::optional< int > limit, std::optional< int > maxDepth, std::optional< std::string > from)
Definition: space_hierarchy.cpp:13
GetSpaceHierarchyJob(std::string serverUrl, std::string _accessToken, std::string roomId, std::optional< bool > suggestedOnly=std::nullopt, std::optional< int > limit=std::nullopt, std::optional< int > maxDepth=std::nullopt, std::optional< std::string > from=std::nullopt)
Retrieve a portion of a space tree.
Definition: space_hierarchy.cpp:40
GetSpaceHierarchyJob withData(JsonWrap j) &&
Definition: space_hierarchy.cpp:60
static constexpr auto needsAuth()
Definition: space_hierarchy.hpp:104
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
Paginates over the space tree in a depth-first manner to locate child rooms of a given space.
Definition: space_hierarchy.hpp:49
std::optional< std::string > topic
The topic of the room, if any.
Definition: space_hierarchy.hpp:70
std::optional< std::string > joinRule
The room's join rule.
Definition: space_hierarchy.hpp:75
bool guestCanJoin
Whether guest users may join the room and participate in it.
Definition: space_hierarchy.hpp:59
immer::array< StrippedChildStateEvent > childrenState
The m.space.child events of the space-room, represented as Stripped State Events with an added origin...
Definition: space_hierarchy.hpp:64
std::optional< std::string > canonicalAlias
The canonical alias of the room, if any.
Definition: space_hierarchy.hpp:66
std::string roomId
The ID of the room.
Definition: space_hierarchy.hpp:53
bool worldReadable
Whether the room may be viewed by guest users without joining.
Definition: space_hierarchy.hpp:55
std::optional< std::string > name
The name of the room, if any.
Definition: space_hierarchy.hpp:68
int numJoinedMembers
The number of members joined to the room.
Definition: space_hierarchy.hpp:51
std::optional< std::string > avatarUrl
The URL for the room's avatar, if one is set.
Definition: space_hierarchy.hpp:72
std::optional< std::string > roomType
The type of room (from m.room.create), if any.
Definition: space_hierarchy.hpp:77
Paginates over the space tree in a depth-first manner to locate child rooms of a given space.
Definition: space_hierarchy.hpp:35
std::int_fast64_t originServerTs
The origin_server_ts for the event.
Definition: space_hierarchy.hpp:37
Definition: basejob.hpp:50
static void from_json(const json &jo, GetSpaceHierarchyJob::ChildRoomsChunk &result)
Definition: space_hierarchy.hpp:220
static void to_json(json &jo, const GetSpaceHierarchyJob::ChildRoomsChunk &pod)
Definition: space_hierarchy.hpp:191
static void from_json(const json &jo, GetSpaceHierarchyJob::StrippedChildStateEvent &result)
Definition: space_hierarchy.hpp:177
static void to_json(json &jo, const GetSpaceHierarchyJob::StrippedChildStateEvent &pod)
Definition: space_hierarchy.hpp:167