ruma_federation_api/membership/create_knock_event/
v1.rs1use ruma_common::{
6 OwnedEventId, OwnedRoomId,
7 api::{request, response},
8 metadata,
9};
10use serde_json::value::RawValue as RawJsonValue;
11
12use crate::{authentication::ServerSignatures, membership::RawStrippedState};
13
14metadata! {
15 method: PUT,
16 rate_limited: false,
17 authentication: ServerSignatures,
18 path: "/_matrix/federation/v1/send_knock/{room_id}/{event_id}",
19}
20
21#[request]
23pub struct Request {
24 #[ruma_api(path)]
26 pub room_id: OwnedRoomId,
27
28 #[ruma_api(path)]
30 pub event_id: OwnedEventId,
31
32 #[ruma_api(body)]
34 pub pdu: Box<RawJsonValue>,
35}
36
37#[response]
39pub struct Response {
40 pub knock_room_state: Vec<RawStrippedState>,
42}
43
44impl Request {
45 pub fn new(room_id: OwnedRoomId, event_id: OwnedEventId, pdu: Box<RawJsonValue>) -> Self {
47 Self { room_id, event_id, pdu }
48 }
49}
50
51impl Response {
52 pub fn new(knock_room_state: Vec<RawStrippedState>) -> Self {
54 Self { knock_room_state }
55 }
56}