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