1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
use ruma_api::ruma_api;
use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::collections::HashMap;
ruma_api! {
metadata {
description: "Gets information about the server's supported feature set and other relevant capabilities.",
method: GET,
name: "get_capabilities",
path: "/_matrix/client/r0/capabilities",
rate_limited: true,
requires_authentication: true
}
request {}
response {
pub capabilities: Capabilities,
}
error: crate::Error
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Capabilities {
#[serde(rename = "m.change_password", skip_serializing_if = "Option::is_none")]
pub change_password: Option<ChangePasswordCapability>,
#[serde(rename = "m.room_versions", skip_serializing_if = "Option::is_none")]
pub room_versions: Option<RoomVersionsCapability>,
#[serde(flatten)]
pub custom_capabilities: HashMap<String, Value>,
}
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
pub struct ChangePasswordCapability {
pub enabled: bool,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct RoomVersionsCapability {
pub default: String,
pub available: HashMap<String, RoomVersionStability>,
}
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
pub enum RoomVersionStability {
#[serde(rename = "stable")]
Stable,
#[serde(rename = "unstable")]
Unstable,
}