ruma_client_api/reporting/
report_user.rs
1pub mod v3 {
6 use ruma_common::{
11 api::{request, response, Metadata},
12 metadata, OwnedUserId,
13 };
14
15 const METADATA: Metadata = metadata! {
16 method: POST,
17 rate_limited: true,
18 authentication: AccessToken,
19 history: {
20 unstable => "/_matrix/client/unstable/org.matrix.msc4260/users/:user_id/report",
21 1.14 => "/_matrix/client/v3/users/:user_id/report",
22 }
23 };
24
25 #[request(error = crate::Error)]
27 pub struct Request {
28 #[ruma_api(path)]
30 pub user_id: OwnedUserId,
31
32 pub reason: String,
34 }
35
36 #[response(error = crate::Error)]
38 #[derive(Default)]
39 pub struct Response {}
40
41 impl Request {
42 pub fn new(user_id: OwnedUserId, reason: String) -> Self {
44 Self { user_id, reason }
45 }
46 }
47
48 impl Response {
49 pub fn new() -> Self {
51 Self {}
52 }
53 }
54}