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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
use std::{collections::BTreeMap, time::Duration};
use ruma_api::ruma_api;
use ruma_common::encryption::DeviceKeys;
use ruma_identifiers::{DeviceIdBox, UserId};
use serde_json::Value as JsonValue;
#[cfg(feature = "unstable-pre-spec")]
use ruma_common::encryption::CrossSigningKey;
ruma_api! {
metadata: {
description: "Returns the current devices and identity keys for the given users.",
method: POST,
name: "get_keys",
path: "/_matrix/client/r0/keys/query",
rate_limited: false,
authentication: AccessToken,
}
#[derive(Default)]
request: {
#[serde(
with = "ruma_serde::duration::opt_ms",
default,
skip_serializing_if = "Option::is_none",
)]
pub timeout: Option<Duration>,
pub device_keys: BTreeMap<UserId, Vec<DeviceIdBox>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub token: Option<&'a str>,
}
#[derive(Default)]
response: {
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
pub failures: BTreeMap<String, JsonValue>,
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
pub device_keys: BTreeMap<UserId, BTreeMap<DeviceIdBox, DeviceKeys>>,
#[cfg(feature = "unstable-pre-spec")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
pub master_keys: BTreeMap<UserId, CrossSigningKey>,
#[cfg(feature = "unstable-pre-spec")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
pub self_signing_keys: BTreeMap<UserId, CrossSigningKey>,
#[cfg(feature = "unstable-pre-spec")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
pub user_signing_keys: BTreeMap<UserId, CrossSigningKey>,
}
error: crate::Error
}
impl Request<'_> {
pub fn new() -> Self {
Default::default()
}
}
impl Response {
pub fn new() -> Self {
Default::default()
}
}