pub mod v3 {
use ruma_common::{
OwnedRoomAliasId, OwnedRoomId, OwnedServerName,
api::{auth_scheme::NoAuthentication, request, response},
metadata,
};
metadata! {
method: GET,
rate_limited: false,
authentication: NoAuthentication,
history: {
1.0 => "/_matrix/client/r0/directory/room/{room_alias}",
1.1 => "/_matrix/client/v3/directory/room/{room_alias}",
}
}
#[request(error = crate::Error)]
pub struct Request {
#[ruma_api(path)]
pub room_alias: OwnedRoomAliasId,
}
#[response(error = crate::Error)]
pub struct Response {
pub room_id: OwnedRoomId,
pub servers: Vec<OwnedServerName>,
}
impl Request {
pub fn new(room_alias: OwnedRoomAliasId) -> Self {
Self { room_alias }
}
}
impl Response {
pub fn new(room_id: OwnedRoomId, servers: Vec<OwnedServerName>) -> Self {
Self { room_id, servers }
}
}
}