ruma_client_api/device/
delete_device.rs1pub mod v3 {
6 use ruma_common::{
11 OwnedDeviceId,
12 api::{auth_scheme::AccessToken, request, response},
13 metadata,
14 };
15
16 use crate::uiaa::{AuthData, UiaaResponse};
17
18 metadata! {
19 method: DELETE,
20 rate_limited: false,
21 authentication: AccessToken,
22 history: {
23 1.0 => "/_matrix/client/r0/devices/{device_id}",
24 1.1 => "/_matrix/client/v3/devices/{device_id}",
25 }
26 }
27
28 #[request(error = UiaaResponse)]
30 pub struct Request {
31 #[ruma_api(path)]
33 pub device_id: OwnedDeviceId,
34
35 #[serde(skip_serializing_if = "Option::is_none")]
37 pub auth: Option<AuthData>,
38 }
39
40 #[response(error = UiaaResponse)]
42 #[derive(Default)]
43 pub struct Response {}
44
45 impl Request {
46 pub fn new(device_id: OwnedDeviceId) -> Self {
48 Self { device_id, auth: None }
49 }
50 }
51
52 impl Response {
53 pub fn new() -> Self {
55 Self {}
56 }
57 }
58}