ruma_client_api/account/
deactivate.rs1pub mod v3 {
6    use ruma_common::{
11        api::{request, response, Metadata},
12        metadata,
13    };
14
15    use crate::{
16        account::ThirdPartyIdRemovalStatus,
17        uiaa::{AuthData, UiaaResponse},
18    };
19
20    const METADATA: Metadata = metadata! {
21        method: POST,
22        rate_limited: true,
23        authentication: AccessTokenOptional,
24        history: {
25            1.0 => "/_matrix/client/r0/account/deactivate",
26            1.1 => "/_matrix/client/v3/account/deactivate",
27        }
28    };
29
30    #[request(error = UiaaResponse)]
32    #[derive(Default)]
33    pub struct Request {
34        #[serde(skip_serializing_if = "Option::is_none")]
36        pub auth: Option<AuthData>,
37
38        #[serde(skip_serializing_if = "Option::is_none")]
41        pub id_server: Option<String>,
42
43        #[serde(default, skip_serializing_if = "ruma_common::serde::is_default")]
48        pub erase: bool,
49    }
50
51    #[response(error = UiaaResponse)]
53    pub struct Response {
54        pub id_server_unbind_result: ThirdPartyIdRemovalStatus,
56    }
57
58    impl Request {
59        pub fn new() -> Self {
61            Default::default()
62        }
63    }
64
65    impl Response {
66        pub fn new(id_server_unbind_result: ThirdPartyIdRemovalStatus) -> Self {
68            Self { id_server_unbind_result }
69        }
70    }
71}