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::{auth_scheme::NoAuthentication, request, response},
10        metadata,
11    };
12
13    metadata! {
14        method: GET,
15        rate_limited: false,
16        authentication: NoAuthentication,
17        path: "/_matrix/federation/unstable/org.matrix.msc3723/versions",
18    }
19
20    /// Request type for the `get_server_versions` endpoint.
21    #[request]
22    #[derive(Default)]
23    pub struct Request {}
24
25    /// Response type for the `get_server_versions` endpoint.
26    #[response]
27    #[derive(Default)]
28    pub struct Response {
29        /// A list of Matrix Server API protocol versions supported by the homeserver.
30        pub versions: Vec<String>,
31    }
32
33    impl Request {
34        /// Creates an empty `Request`.
35        pub fn new() -> Self {
36            Self {}
37        }
38    }
39
40    impl Response {
41        /// Creates an empty `Response`.
42        pub fn new() -> Self {
43            Default::default()
44        }
45    }
46}