ruma_client_api/account/
delete_3pid.rs1pub mod v3 {
6    use ruma_common::{
11        api::{request, response, Metadata},
12        metadata,
13        thirdparty::Medium,
14    };
15
16    use crate::account::ThirdPartyIdRemovalStatus;
17
18    const METADATA: Metadata = metadata! {
19        method: POST,
20        rate_limited: false,
21        authentication: AccessToken,
22        history: {
23            1.0 => "/_matrix/client/r0/account/3pid/delete",
24            1.1 => "/_matrix/client/v3/account/3pid/delete",
25        }
26    };
27
28    #[request(error = crate::Error)]
30    pub struct Request {
31        #[serde(skip_serializing_if = "Option::is_none")]
33        pub id_server: Option<String>,
34
35        pub medium: Medium,
37
38        pub address: String,
40    }
41
42    #[response(error = crate::Error)]
44    pub struct Response {
45        pub id_server_unbind_result: ThirdPartyIdRemovalStatus,
47    }
48
49    impl Request {
50        pub fn new(medium: Medium, address: String) -> Self {
52            Self { id_server: None, medium, address }
53        }
54    }
55}