ruma_client_api/membership/
join_room_by_id.rs1pub mod v3 {
6 use ruma_common::{
11 OwnedRoomId,
12 api::{auth_scheme::AccessToken, request, response},
13 metadata,
14 };
15
16 use crate::membership::ThirdPartySigned;
17
18 metadata! {
19 method: POST,
20 rate_limited: true,
21 authentication: AccessToken,
22 history: {
23 1.0 => "/_matrix/client/r0/rooms/{room_id}/join",
24 1.1 => "/_matrix/client/v3/rooms/{room_id}/join",
25 }
26 }
27
28 #[request(error = crate::Error)]
30 pub struct Request {
31 #[ruma_api(path)]
33 pub room_id: OwnedRoomId,
34
35 #[serde(skip_serializing_if = "Option::is_none")]
38 pub third_party_signed: Option<ThirdPartySigned>,
39
40 #[serde(skip_serializing_if = "Option::is_none")]
42 pub reason: Option<String>,
43 }
44
45 #[response(error = crate::Error)]
47 pub struct Response {
48 pub room_id: OwnedRoomId,
50 }
51
52 impl Request {
53 pub fn new(room_id: OwnedRoomId) -> Self {
55 Self { room_id, third_party_signed: None, reason: None }
56 }
57 }
58
59 impl Response {
60 pub fn new(room_id: OwnedRoomId) -> Self {
62 Self { room_id }
63 }
64 }
65}