use ruma_api::ruma_api;
use ruma_events::AnyRoomEvent;
use ruma_identifiers::{EventId, RoomId};
use ruma_serde::Raw;
ruma_api! {
metadata: {
description: "Get a single event based on roomId/eventId",
method: GET,
name: "get_room_event",
path: "/_matrix/client/r0/rooms/:room_id/event/:event_id",
rate_limited: false,
authentication: AccessToken,
}
request: {
#[ruma_api(path)]
pub room_id: &'a RoomId,
#[ruma_api(path)]
pub event_id: &'a EventId,
}
response: {
#[ruma_api(body)]
pub event: Raw<AnyRoomEvent>,
}
error: crate::Error
}
impl<'a> Request<'a> {
pub fn new(room_id: &'a RoomId, event_id: &'a EventId) -> Self {
Self { room_id, event_id }
}
}
impl Response {
pub fn new(event: Raw<AnyRoomEvent>) -> Self {
Self { event }
}
}