ruma_client_api/room/
report_content.rs1pub mod v3 {
6 use ruma_common::{
11 OwnedEventId, OwnedRoomId,
12 api::{auth_scheme::AccessToken, request, response},
13 metadata,
14 };
15
16 metadata! {
17 method: POST,
18 rate_limited: false,
19 authentication: AccessToken,
20 history: {
21 1.0 => "/_matrix/client/r0/rooms/{room_id}/report/{event_id}",
22 1.1 => "/_matrix/client/v3/rooms/{room_id}/report/{event_id}",
23 }
24 }
25
26 #[request(error = crate::Error)]
28 pub struct Request {
29 #[ruma_api(path)]
31 pub room_id: OwnedRoomId,
32
33 #[ruma_api(path)]
35 pub event_id: OwnedEventId,
36
37 #[serde(skip_serializing_if = "Option::is_none")]
39 pub reason: Option<String>,
40 }
41
42 #[response(error = crate::Error)]
44 #[derive(Default)]
45 pub struct Response {}
46
47 impl Request {
48 pub fn new(room_id: OwnedRoomId, event_id: OwnedEventId) -> Self {
50 Self { room_id, event_id, reason: None }
51 }
52 }
53
54 impl Response {
55 pub fn new() -> Self {
57 Self {}
58 }
59 }
60}