1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
use ruma::{api::ruma_api, UserId};
ruma_api! {
metadata: {
description: "password reset endpoint",
method: POST,
name: "reset_password_v1",
unstable_path: "/_synapse/admin/v1/reset_password/:user_id",
rate_limited: false,
authentication: AccessToken,
}
request: {
#[ruma_api(path)]
pub user_id: &'a UserId,
pub new_password: &'a str,
#[serde(default = "ruma::serde::default_true")]
pub logout_devices: bool,
}
#[derive(Default)]
response: {}
}
impl<'a> Request<'a> {
pub fn new(user_id: &'a UserId, new_password: &'a str) -> Self {
Self { user_id, new_password, logout_devices: true }
}
}
impl Response {
pub fn new() -> Self {
Self {}
}
}