use ruma_api::ruma_api;
use ruma_identifiers::{RoomAliasId, RoomId, ServerNameBox};
ruma_api! {
metadata: {
description: "Resolve a room alias to a room ID.",
method: GET,
name: "get_alias",
path: "/_matrix/client/r0/directory/room/:room_alias",
rate_limited: false,
authentication: None,
}
request: {
#[ruma_api(path)]
pub room_alias: &'a RoomAliasId,
}
response: {
pub room_id: RoomId,
pub servers: Vec<ServerNameBox>,
}
error: crate::Error
}
impl<'a> Request<'a> {
pub fn new(room_alias: &'a RoomAliasId) -> Self {
Self { room_alias }
}
}
impl Response {
pub fn new(room_id: RoomId, servers: Vec<ServerNameBox>) -> Self {
Self { room_id, servers }
}
}