ruma_federation_api/discovery/
get_server_versions.rs

1//! Endpoint to receive metadata about implemented matrix versions.
2//!
3//! Get the supported matrix versions of this homeserver
4
5pub mod msc3723 {
6    //! [GET /_matrix/federation/versions](https://github.com/matrix-org/matrix-spec-proposals/pull/3723)
7
8    use ruma_common::{
9        api::{request, response, Metadata},
10        metadata,
11    };
12
13    const METADATA: Metadata = metadata! {
14        method: GET,
15        rate_limited: false,
16        authentication: None,
17        history: {
18            unstable => "/_matrix/federation/unstable/org.matrix.msc3723/versions",
19        }
20    };
21
22    /// Request type for the `get_server_versions` endpoint.
23    #[request]
24    #[derive(Default)]
25    pub struct Request {}
26
27    /// Response type for the `get_server_versions` endpoint.
28    #[response]
29    #[derive(Default)]
30    pub struct Response {
31        /// A list of Matrix Server API protocol versions supported by the homeserver.
32        pub versions: Vec<String>,
33    }
34
35    impl Request {
36        /// Creates an empty `Request`.
37        pub fn new() -> Self {
38            Self {}
39        }
40    }
41
42    impl Response {
43        /// Creates an empty `Response`.
44        pub fn new() -> Self {
45            Default::default()
46        }
47    }
48}