ruma_client_api/alias/
delete_alias.rs

1//! `DELETE /_matrix/client/*/directory/room/{roomAlias}`
2//!
3//! Remove an alias from a room.
4
5pub mod v3 {
6    //! `/v3/` ([spec])
7    //!
8    //! [spec]: https://spec.matrix.org/latest/client-server-api/#delete_matrixclientv3directoryroomroomalias
9
10    use ruma_common::{
11        OwnedRoomAliasId,
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            1.0 => "/_matrix/client/r0/directory/room/{room_alias}",
22            1.1 => "/_matrix/client/v3/directory/room/{room_alias}",
23        }
24    }
25
26    /// Request type for the `delete_alias` endpoint.
27    #[request(error = crate::Error)]
28    pub struct Request {
29        /// The room alias to remove.
30        #[ruma_api(path)]
31        pub room_alias: OwnedRoomAliasId,
32    }
33
34    /// Response type for the `delete_alias` endpoint.
35    #[response(error = crate::Error)]
36    #[derive(Default)]
37    pub struct Response {}
38
39    impl Request {
40        /// Creates a new `Request` with the given room alias.
41        pub fn new(room_alias: OwnedRoomAliasId) -> Self {
42            Self { room_alias }
43        }
44    }
45
46    impl Response {
47        /// Creates an empty `Response`.
48        pub fn new() -> Self {
49            Self {}
50        }
51    }
52}