ruma_client_api/alias/
create_alias.rs1pub mod v3 {
6 use ruma_common::{
11 OwnedRoomAliasId, OwnedRoomId,
12 api::{auth_scheme::AccessToken, request, response},
13 metadata,
14 };
15
16 metadata! {
17 method: PUT,
18 rate_limited: false,
19 authentication: AccessToken,
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 pub room_id: OwnedRoomId,
35 }
36
37 #[response(error = crate::Error)]
39 #[derive(Default)]
40 pub struct Response {}
41
42 impl Request {
43 pub fn new(room_alias: OwnedRoomAliasId, room_id: OwnedRoomId) -> Self {
45 Self { room_alias, room_id }
46 }
47 }
48
49 impl Response {
50 pub fn new() -> Self {
52 Self {}
53 }
54 }
55}