ruma_client_api/backup/
get_backup_keys.rs1pub mod v3 {
6 use std::collections::BTreeMap;
11
12 use ruma_common::{
13 OwnedRoomId,
14 api::{auth_scheme::AccessToken, request, response},
15 metadata,
16 };
17
18 use crate::backup::RoomKeyBackup;
19
20 metadata! {
21 method: GET,
22 rate_limited: true,
23 authentication: AccessToken,
24 history: {
25 unstable => "/_matrix/client/unstable/room_keys/keys",
26 1.0 => "/_matrix/client/r0/room_keys/keys",
27 1.1 => "/_matrix/client/v3/room_keys/keys",
28 }
29 }
30
31 #[request(error = crate::Error)]
33 pub struct Request {
34 #[ruma_api(query)]
36 pub version: String,
37 }
38
39 #[response(error = crate::Error)]
41 pub struct Response {
42 pub rooms: BTreeMap<OwnedRoomId, RoomKeyBackup>,
44 }
45
46 impl Request {
47 pub fn new(version: String) -> Self {
49 Self { version }
50 }
51 }
52
53 impl Response {
54 pub fn new(rooms: BTreeMap<OwnedRoomId, RoomKeyBackup>) -> Self {
56 Self { rooms }
57 }
58 }
59}