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
use ruma::{api::ruma_api, RoomId, UInt, UserId};
ruma_api! {
metadata: {
description: "list room memberships of a user",
method: GET,
name: "list_joined_rooms_v1",
unstable_path: "/_synapse/admin/v1/users/:user_id/joined_rooms",
rate_limited: false,
authentication: AccessToken,
}
request: {
#[ruma_api(path)]
pub user_id: &'a UserId,
}
response: {
pub joined_rooms: Vec<Box<RoomId>>,
pub total: UInt,
}
}
impl<'a> Request<'a> {
pub fn new(user_id: &'a UserId) -> Self {
Self { user_id }
}
}
impl Response {
pub fn new(joined_rooms: Vec<Box<RoomId>>, total: UInt) -> Self {
Self { joined_rooms, total }
}
}