ruma_client_api/directory/
set_room_visibility.rs1pub mod v3 {
6 use ruma_common::{
11 OwnedRoomId,
12 api::{auth_scheme::AccessToken, request, response},
13 metadata,
14 };
15
16 use crate::room::Visibility;
17
18 metadata! {
19 method: PUT,
20 rate_limited: false,
21 authentication: AccessToken,
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 pub visibility: Visibility,
37 }
38
39 #[response(error = crate::Error)]
41 #[derive(Default)]
42 pub struct Response {}
43
44 impl Request {
45 pub fn new(room_id: OwnedRoomId, visibility: Visibility) -> Self {
47 Self { room_id, visibility }
48 }
49 }
50
51 impl Response {
52 pub fn new() -> Self {
54 Self {}
55 }
56 }
57}