ruma_client_api/alias/
get_alias.rs1pub mod v3 {
6 use ruma_common::{
11 OwnedRoomAliasId, OwnedRoomId, OwnedServerName,
12 api::{auth_scheme::NoAuthentication, request, response},
13 metadata,
14 };
15
16 metadata! {
17 method: GET,
18 rate_limited: false,
19 authentication: NoAuthentication,
20 history: {
21 1.0 => "/_matrix/client/r0/directory/room/{room_alias}",
22 1.1 => "/_matrix/client/v3/directory/room/{room_alias}",
23 }
24 }
25
26 #[request(error = crate::Error)]
28 pub struct Request {
29 #[ruma_api(path)]
31 pub room_alias: OwnedRoomAliasId,
32 }
33
34 #[response(error = crate::Error)]
36 pub struct Response {
37 pub room_id: OwnedRoomId,
39
40 pub servers: Vec<OwnedServerName>,
42 }
43
44 impl Request {
45 pub fn new(room_alias: OwnedRoomAliasId) -> Self {
47 Self { room_alias }
48 }
49 }
50
51 impl Response {
52 pub fn new(room_id: OwnedRoomId, servers: Vec<OwnedServerName>) -> Self {
54 Self { room_id, servers }
55 }
56 }
57}