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 api::{request, response},
12 metadata, OwnedDeviceId,
13 };
14
15 metadata! {
16 method: DELETE,
17 rate_limited: false,
18 authentication: AccessToken,
19 history: {
20 unstable => "/_matrix/client/unstable/org.matrix.msc3814.v1/dehydrated_device",
21 }
22 }
23
24 /// Request type for the `DELETE` `dehydrated_device` endpoint.
25 #[request(error = crate::Error)]
26 pub struct Request {}
27
28 /// Request type for the `DELETE` `dehydrated_device` endpoint.
29 #[response(error = crate::Error)]
30 pub struct Response {
31 /// The unique ID of the device that was deleted.
32 pub device_id: OwnedDeviceId,
33 }
34
35 impl Request {
36 /// Creates a new empty `Request`.
37 pub fn new() -> Self {
38 Self {}
39 }
40 }
41
42 impl Response {
43 /// Creates a new `Response` with the given device ID.
44 pub fn new(device_id: OwnedDeviceId) -> Self {
45 Self { device_id }
46 }
47 }
48}