ruma_client_api/directory/
get_room_visibility.rs1pub mod v3 {
6 use ruma_common::{
11 OwnedRoomId,
12 api::{auth_scheme::NoAuthentication, request, response},
13 metadata,
14 };
15
16 use crate::room::Visibility;
17
18 metadata! {
19 method: GET,
20 rate_limited: false,
21 authentication: NoAuthentication,
22 history: {
23 1.0 => "/_matrix/client/r0/directory/list/room/{room_id}",
24 1.1 => "/_matrix/client/v3/directory/list/room/{room_id}",
25 }
26 }
27
28 #[request(error = crate::Error)]
30 pub struct Request {
31 #[ruma_api(path)]
33 pub room_id: OwnedRoomId,
34 }
35
36 #[response(error = crate::Error)]
38 pub struct Response {
39 pub visibility: Visibility,
41 }
42
43 impl Request {
44 pub fn new(room_id: OwnedRoomId) -> Self {
46 Self { room_id }
47 }
48 }
49
50 impl Response {
51 pub fn new(visibility: Visibility) -> Self {
53 Self { visibility }
54 }
55 }
56}