ruma_client_api/room/
upgrade_room.rs1pub mod v3 {
6 use ruma_common::{
11 api::{request, response, Metadata},
12 metadata, OwnedRoomId, RoomVersionId,
13 };
14
15 const METADATA: Metadata = metadata! {
16 method: POST,
17 rate_limited: false,
18 authentication: AccessToken,
19 history: {
20 1.0 => "/_matrix/client/r0/rooms/:room_id/upgrade",
21 1.1 => "/_matrix/client/v3/rooms/:room_id/upgrade",
22 }
23 };
24
25 #[request(error = crate::Error)]
27 pub struct Request {
28 #[ruma_api(path)]
30 pub room_id: OwnedRoomId,
31
32 pub new_version: RoomVersionId,
34 }
35
36 #[response(error = crate::Error)]
38 pub struct Response {
39 pub replacement_room: OwnedRoomId,
41 }
42
43 impl Request {
44 pub fn new(room_id: OwnedRoomId, new_version: RoomVersionId) -> Self {
46 Self { room_id, new_version }
47 }
48 }
49
50 impl Response {
51 pub fn new(replacement_room: OwnedRoomId) -> Self {
53 Self { replacement_room }
54 }
55 }
56}