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