pub mod v1 {
use js_int::UInt;
use ruma_common::{api::ruma_api, RoomId};
use crate::space::SpaceHierarchyRoomsChunk;
ruma_api! {
metadata: {
description: "Paginates over the space tree in a depth-first manner to locate child rooms of a given space.",
method: GET,
name: "hierarchy",
unstable_path: "/_matrix/client/unstable/org.matrix.msc2946/rooms/:room_id/hierarchy",
stable_path: "/_matrix/client/v1/rooms/:room_id/hierarchy",
rate_limited: true,
authentication: AccessToken,
added: 1.2,
}
request: {
#[ruma_api(path)]
pub room_id: &'a RoomId,
#[ruma_api(query)]
pub from: Option<&'a str>,
#[ruma_api(query)]
pub limit: Option<UInt>,
#[ruma_api(query)]
pub max_depth: Option<UInt>,
#[ruma_api(query)]
#[serde(default, skip_serializing_if = "ruma_common::serde::is_default")]
pub suggested_only: bool,
}
#[derive(Default)]
response: {
#[serde(skip_serializing_if = "Option::is_none")]
pub next_batch: Option<String>,
pub rooms: Vec<SpaceHierarchyRoomsChunk>,
}
error: crate::Error
}
impl<'a> Request<'a> {
pub fn new(room_id: &'a RoomId) -> Self {
Self { room_id, from: None, limit: None, max_depth: None, suggested_only: false }
}
}
impl Response {
pub fn new() -> Self {
Default::default()
}
}
}