synapse_admin_api/users/is_user_admin/
v1.rs1use ruma::{
4 api::{metadata, request, response, Metadata},
5 OwnedUserId,
6};
7
8const METADATA: Metadata = metadata! {
9 method: GET,
10 rate_limited: false,
11 authentication: AccessToken,
12 history: {
13 unstable => "/_synapse/admin/v1/users/{user_id}/admin",
14 }
15};
16
17#[request]
18pub struct Request {
19 #[ruma_api(path)]
21 pub user_id: OwnedUserId,
22}
23
24#[response]
25pub struct Response {
26 pub admin: bool,
28}
29
30impl Request {
31 pub fn new(user_id: OwnedUserId) -> Self {
33 Self { user_id }
34 }
35}
36
37impl Response {
38 pub fn new(admin: bool) -> Self {
40 Self { admin }
41 }
42}