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
use std::collections::BTreeMap;
use ruma_api::ruma_api;
use ruma_identifiers::UserId;
use crate::lookup::IdentifierHashingAlgorithm;
ruma_api! {
metadata: {
description: "Looks up the set of Matrix User IDs which have bound the 3PIDs given, if bindings are available.",
method: POST,
name: "lookup_3pid",
path: "/_matrix/identity/v2/lookup",
authentication: AccessToken,
rate_limited: false,
}
request: {
pub algorithm: &'a IdentifierHashingAlgorithm,
pub pepper: &'a str,
pub addresses: &'a [String],
}
response: {
pub mappings: BTreeMap<String, UserId>,
}
}
impl<'a> Request<'a> {
pub fn new(
algorithm: &'a IdentifierHashingAlgorithm,
pepper: &'a str,
addresses: &'a [String],
) -> Self {
Self { algorithm, pepper, addresses }
}
}
impl Response {
pub fn new(mappings: BTreeMap<String, UserId>) -> Self {
Self { mappings }
}
}