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