pub mod v3 {
use ruma_common::{
api::{request, response, Metadata},
metadata, OwnedRoomId, RoomVersionId,
};
const METADATA: Metadata = metadata! {
method: POST,
rate_limited: false,
authentication: AccessToken,
history: {
1.0 => "/_matrix/client/r0/rooms/:room_id/upgrade",
1.1 => "/_matrix/client/v3/rooms/:room_id/upgrade",
}
};
#[request(error = crate::Error)]
pub struct Request {
#[ruma_api(path)]
pub room_id: OwnedRoomId,
pub new_version: RoomVersionId,
}
#[response(error = crate::Error)]
pub struct Response {
pub replacement_room: OwnedRoomId,
}
impl Request {
pub fn new(room_id: OwnedRoomId, new_version: RoomVersionId) -> Self {
Self { room_id, new_version }
}
}
impl Response {
pub fn new(replacement_room: OwnedRoomId) -> Self {
Self { replacement_room }
}
}
}