ruma_client_api/dehydrated_device/delete_dehydrated_device.rs
1//! `DELETE /_matrix/client/*/dehydrated_device/`
2//!
3//! Delete a dehydrated device.
4
5pub mod unstable {
6 //! `msc3814` ([MSC])
7 //!
8 //! [MSC]: https://github.com/matrix-org/matrix-spec-proposals/pull/3814
9
10 use ruma_common::{
11 OwnedDeviceId,
12 api::{auth_scheme::AccessToken, request, response},
13 metadata,
14 };
15
16 metadata! {
17 method: DELETE,
18 rate_limited: false,
19 authentication: AccessToken,
20 history: {
21 unstable => "/_matrix/client/unstable/org.matrix.msc3814.v1/dehydrated_device",
22 }
23 }
24
25 /// Request type for the `DELETE` `dehydrated_device` endpoint.
26 #[request(error = crate::Error)]
27 pub struct Request {}
28
29 /// Request type for the `DELETE` `dehydrated_device` endpoint.
30 #[response(error = crate::Error)]
31 pub struct Response {
32 /// The unique ID of the device that was deleted.
33 pub device_id: OwnedDeviceId,
34 }
35
36 impl Request {
37 /// Creates a new empty `Request`.
38 pub fn new() -> Self {
39 Self {}
40 }
41 }
42
43 impl Response {
44 /// Creates a new `Response` with the given device ID.
45 pub fn new(device_id: OwnedDeviceId) -> Self {
46 Self { device_id }
47 }
48 }
49}