ruma_client_api/room/
aliases.rs1pub mod v3 {
6    use ruma_common::{
11        api::{request, response, Metadata},
12        metadata, OwnedRoomAliasId, OwnedRoomId,
13    };
14
15    const METADATA: Metadata = metadata! {
16        method: GET,
17        rate_limited: true,
18        authentication: AccessToken,
19        history: {
20            unstable => "/_matrix/client/unstable/org.matrix.msc2432/rooms/:room_id/aliases",
21            1.0 => "/_matrix/client/r0/rooms/:room_id/aliases",
22            1.1 => "/_matrix/client/v3/rooms/:room_id/aliases",
23        }
24    };
25
26    #[request(error = crate::Error)]
28    pub struct Request {
29        #[ruma_api(path)]
31        pub room_id: OwnedRoomId,
32    }
33
34    #[response(error = crate::Error)]
36    pub struct Response {
37        pub aliases: Vec<OwnedRoomAliasId>,
39    }
40
41    impl Request {
42        pub fn new(room_id: OwnedRoomId) -> Self {
44            Self { room_id }
45        }
46    }
47
48    impl Response {
49        pub fn new(aliases: Vec<OwnedRoomAliasId>) -> Self {
51            Self { aliases }
52        }
53    }
54}