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