synapse_admin_api/users/get_details/
v2.rs

1//! [GET /_synapse/admin/v2/users/:user_id](https://github.com/matrix-org/synapse/blob/master/docs/admin_api/user_admin_api.rst#query-user-account)
2
3use ruma::{
4    api::{metadata, request, response, Metadata},
5    OwnedUserId,
6};
7
8pub use crate::users::UserDetails;
9
10const METADATA: Metadata = metadata! {
11    method: GET,
12    rate_limited: false,
13    authentication: AccessToken,
14    history: {
15        unstable => "/_synapse/admin/v2/users/{user_id}",
16    }
17};
18
19#[request]
20pub struct Request {
21    /// user ID
22    #[ruma_api(path)]
23    pub user_id: OwnedUserId,
24}
25
26#[response]
27pub struct Response {
28    /// Details about the user.
29    #[ruma_api(body)]
30    pub details: UserDetails,
31}
32
33impl Request {
34    /// Creates an `Request` with the given user ID.
35    pub fn new(user_id: OwnedUserId) -> Self {
36        Self { user_id }
37    }
38}
39
40impl Response {
41    /// Creates a new `Response` with all parameters defaulted.
42    pub fn new(details: UserDetails) -> Self {
43        Self { details }
44    }
45}