ruma_client_api/backup/
create_backup_version.rs1pub mod v3 {
6    use ruma_common::{
11        api::{request, response, Metadata},
12        metadata,
13        serde::Raw,
14    };
15
16    use crate::backup::BackupAlgorithm;
17
18    const METADATA: Metadata = metadata! {
19        method: POST,
20        rate_limited: true,
21        authentication: AccessToken,
22        history: {
23            unstable => "/_matrix/client/unstable/room_keys/version",
24            1.1 => "/_matrix/client/v3/room_keys/version",
25        }
26    };
27
28    #[request(error = crate::Error)]
30    pub struct Request {
31        #[ruma_api(body)]
33        pub algorithm: Raw<BackupAlgorithm>,
34    }
35
36    #[response(error = crate::Error)]
38    pub struct Response {
39        pub version: String,
41    }
42
43    impl Request {
44        pub fn new(algorithm: Raw<BackupAlgorithm>) -> Self {
46            Self { algorithm }
47        }
48    }
49
50    impl Response {
51        pub fn new(version: String) -> Self {
53            Self { version }
54        }
55    }
56}