pub mod v3 {
use ruma_common::{
api::{request, response, Metadata},
events::AnyStateEvent,
metadata,
serde::Raw,
OwnedRoomId,
};
const METADATA: Metadata = metadata! {
method: GET,
rate_limited: false,
authentication: AccessToken,
history: {
1.0 => "/_matrix/client/r0/rooms/:room_id/state",
1.1 => "/_matrix/client/v3/rooms/:room_id/state",
}
};
#[request(error = crate::Error)]
pub struct Request {
#[ruma_api(path)]
pub room_id: OwnedRoomId,
}
#[response(error = crate::Error)]
pub struct Response {
#[ruma_api(body)]
pub room_state: Vec<Raw<AnyStateEvent>>,
}
impl Request {
pub fn new(room_id: OwnedRoomId) -> Self {
Self { room_id }
}
}
impl Response {
pub fn new(room_state: Vec<Raw<AnyStateEvent>>) -> Self {
Self { room_state }
}
}
}