ruma_client_api/threads/
unsubscribe_thread.rs

1//! `DELETE /_matrix/client/*/rooms/{roomId}/thread/{eventId}/subscription`
2//!
3//! Removes the subscription state of the current user to a thread in a room.
4
5pub mod unstable {
6    //! `/unstable/` ([spec])
7    //!
8    //! [spec]: https://github.com/matrix-org/matrix-spec-proposals/pull/4306
9
10    use ruma_common::{
11        OwnedEventId, OwnedRoomId,
12        api::{auth_scheme::AccessToken, request, response},
13        metadata,
14    };
15
16    metadata! {
17        method: DELETE,
18        rate_limited: true,
19        authentication: AccessToken,
20        history: {
21            unstable("org.matrix.msc4306") => "/_matrix/client/unstable/io.element.msc4306/rooms/{room_id}/thread/{thread_root}/subscription",
22        }
23    }
24
25    /// Request type for the `unsubscribe_thread` endpoint.
26    #[request(error = crate::Error)]
27    pub struct Request {
28        /// The room ID where the thread is located.
29        #[ruma_api(path)]
30        pub room_id: OwnedRoomId,
31
32        /// The event ID of the thread root to unsubscribe to.
33        #[ruma_api(path)]
34        pub thread_root: OwnedEventId,
35    }
36
37    /// Response type for the `unsubscribe_thread` endpoint.
38    #[response(error = crate::Error)]
39    pub struct Response {}
40
41    impl Request {
42        /// Creates a new `Request` for the given room and thread IDs.
43        pub fn new(room_id: OwnedRoomId, thread_root: OwnedEventId) -> Self {
44            Self { room_id, thread_root }
45        }
46    }
47
48    impl Response {
49        /// Creates a new `Response`.
50        pub fn new() -> Self {
51            Self {}
52        }
53    }
54}