ruma_federation_api/discovery/
get_server_version.rs1pub mod v1 {
6 use ruma_common::{
11 api::{auth_scheme::NoAuthentication, request, response},
12 metadata,
13 };
14 use serde::{Deserialize, Serialize};
15
16 metadata! {
17 method: GET,
18 rate_limited: false,
19 authentication: NoAuthentication,
20 path: "/_matrix/federation/v1/version",
21 }
22
23 #[request]
25 #[derive(Default)]
26 pub struct Request {}
27
28 #[response]
30 #[derive(Default)]
31 pub struct Response {
32 #[serde(skip_serializing_if = "Option::is_none")]
34 pub server: Option<Server>,
35 }
36
37 impl Request {
38 pub fn new() -> Self {
40 Self {}
41 }
42 }
43
44 impl Response {
45 pub fn new() -> Self {
47 Default::default()
48 }
49 }
50
51 #[derive(Clone, Debug, Default, Serialize, Deserialize)]
53 #[cfg_attr(not(ruma_unstable_exhaustive_types), non_exhaustive)]
54 pub struct Server {
55 #[serde(skip_serializing_if = "Option::is_none")]
57 pub name: Option<String>,
58
59 #[serde(skip_serializing_if = "Option::is_none")]
63 pub version: Option<String>,
64 }
65
66 impl Server {
67 pub fn new() -> Self {
69 Default::default()
70 }
71 }
72}