ruma_client_api/backup/
delete_backup_version.rs

1//! `DELETE /_matrix/client/*/room_keys/version/{version}`
2//!
3//! Delete a backup version.
4
5pub mod v3 {
6    //! `/v3/` ([spec])
7    //!
8    //! [spec]: https://spec.matrix.org/latest/client-server-api/#delete_matrixclientv3room_keysversionversion
9    //!
10    //! This deletes a backup version and its room keys.
11
12    use ruma_common::{
13        api::{request, response, Metadata},
14        metadata,
15    };
16
17    const METADATA: Metadata = metadata! {
18        method: DELETE,
19        rate_limited: true,
20        authentication: AccessToken,
21        history: {
22            unstable => "/_matrix/client/unstable/room_keys/version/:version",
23            1.0 => "/_matrix/client/r0/room_keys/version/:version",
24            1.1 => "/_matrix/client/v3/room_keys/version/:version",
25        }
26    };
27
28    /// Request type for the `delete_backup_version` endpoint.
29    #[request(error = crate::Error)]
30    pub struct Request {
31        /// The backup version to delete.
32        #[ruma_api(path)]
33        pub version: String,
34    }
35
36    /// Response type for the `delete_backup_version` endpoint.
37    #[response(error = crate::Error)]
38    #[derive(Default)]
39    pub struct Response {}
40
41    impl Request {
42        /// Creates a new `Request` with the given version, room_id and sessions.
43        pub fn new(version: String) -> Self {
44            Self { version }
45        }
46    }
47
48    impl Response {
49        /// Creates an empty `Response`.
50        pub fn new() -> Self {
51            Self {}
52        }
53    }
54}