synapse_admin_api/users/reset_password/
v1.rs1use ruma::{
4 api::{metadata, request, response, Metadata},
5 OwnedUserId,
6};
7
8const METADATA: Metadata = metadata! {
9 method: POST,
10 rate_limited: false,
11 authentication: AccessToken,
12 history: {
13 unstable => "/_synapse/admin/v1/reset_password/:user_id",
14 }
15};
16
17#[request]
18pub struct Request {
19 #[ruma_api(path)]
21 pub user_id: OwnedUserId,
22
23 pub new_password: String,
25
26 #[serde(default = "ruma::serde::default_true")]
29 pub logout_devices: bool,
30}
31
32#[derive(Default)]
33#[response]
34pub struct Response {}
35
36impl Request {
37 pub fn new(user_id: OwnedUserId, new_password: String) -> Self {
39 Self { user_id, new_password, logout_devices: true }
40 }
41}
42
43impl Response {
44 pub fn new() -> Self {
46 Self {}
47 }
48}