ruma_client_api/discovery/get_capabilities/
v3.rs
1use ruma_common::{
6 api::{request, response, Metadata},
7 metadata,
8};
9
10use super::Capabilities;
11
12const METADATA: Metadata = metadata! {
13 method: GET,
14 rate_limited: true,
15 authentication: AccessToken,
16 history: {
17 1.0 => "/_matrix/client/r0/capabilities",
18 1.1 => "/_matrix/client/v3/capabilities",
19 }
20};
21
22#[request(error = crate::Error)]
24#[derive(Default)]
25pub struct Request {}
26
27#[response(error = crate::Error)]
29pub struct Response {
30 pub capabilities: Capabilities,
32}
33
34impl Request {
35 pub fn new() -> Self {
37 Self {}
38 }
39}
40
41impl Response {
42 pub fn new(capabilities: Capabilities) -> Self {
44 Self { capabilities }
45 }
46}
47
48impl From<Capabilities> for Response {
49 fn from(capabilities: Capabilities) -> Self {
50 Self::new(capabilities)
51 }
52}