ruma_client_api/room/
get_room_event.rs1pub mod v3 {
6 use ruma_common::{
11 api::{request, response, Metadata},
12 metadata,
13 serde::Raw,
14 OwnedEventId, OwnedRoomId,
15 };
16 use ruma_events::AnyTimelineEvent;
17
18 const METADATA: Metadata = metadata! {
19 method: GET,
20 rate_limited: false,
21 authentication: AccessToken,
22 history: {
23 1.0 => "/_matrix/client/r0/rooms/:room_id/event/:event_id",
24 1.1 => "/_matrix/client/v3/rooms/:room_id/event/:event_id",
25 }
26 };
27
28 #[request(error = crate::Error)]
30 pub struct Request {
31 #[ruma_api(path)]
33 pub room_id: OwnedRoomId,
34
35 #[ruma_api(path)]
37 pub event_id: OwnedEventId,
38 }
39
40 #[response(error = crate::Error)]
42 pub struct Response {
43 #[ruma_api(body)]
45 pub event: Raw<AnyTimelineEvent>,
46 }
47
48 impl Request {
49 pub fn new(room_id: OwnedRoomId, event_id: OwnedEventId) -> Self {
51 Self { room_id, event_id }
52 }
53 }
54
55 impl Response {
56 pub fn new(event: Raw<AnyTimelineEvent>) -> Self {
58 Self { event }
59 }
60 }
61}