ruma_client_api/account/
add_3pid.rs1pub mod v3 {
6 use ruma_common::{
11 OwnedClientSecret, OwnedSessionId,
12 api::{auth_scheme::AccessToken, request, response},
13 metadata,
14 };
15
16 use crate::uiaa::{AuthData, UiaaResponse};
17
18 metadata! {
19 method: POST,
20 rate_limited: true,
21 authentication: AccessToken,
22 history: {
23 1.0 => "/_matrix/client/r0/account/3pid/add",
24 1.1 => "/_matrix/client/v3/account/3pid/add",
25 }
26 }
27
28 #[request(error = UiaaResponse)]
30 pub struct Request {
31 #[serde(skip_serializing_if = "Option::is_none")]
33 pub auth: Option<AuthData>,
34
35 pub client_secret: OwnedClientSecret,
37
38 pub sid: OwnedSessionId,
40 }
41
42 #[response(error = UiaaResponse)]
44 #[derive(Default)]
45 pub struct Response {}
46
47 impl Request {
48 pub fn new(client_secret: OwnedClientSecret, sid: OwnedSessionId) -> Self {
50 Self { auth: None, client_secret, sid }
51 }
52 }
53
54 impl Response {
55 pub fn new() -> Self {
57 Self {}
58 }
59 }
60}