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