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