ruma_client_api/backup/
update_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: PUT,
20        rate_limited: true,
21        authentication: AccessToken,
22        history: {
23            unstable => "/_matrix/client/unstable/room_keys/version/:version",
24            1.1 => "/_matrix/client/v3/room_keys/version/:version",
25        }
26    };
27
28    #[request(error = crate::Error)]
30    pub struct Request {
31        #[ruma_api(path)]
33        pub version: String,
34
35        #[ruma_api(body)]
37        pub algorithm: Raw<BackupAlgorithm>,
38    }
39
40    #[response(error = crate::Error)]
42    #[derive(Default)]
43    pub struct Response {}
44
45    impl Request {
46        pub fn new(version: String, algorithm: Raw<BackupAlgorithm>) -> Self {
48            Self { version, algorithm }
49        }
50    }
51
52    impl Response {
53        pub fn new() -> Self {
55            Self {}
56        }
57    }
58}