use ruma_common::{
OwnedEventId, OwnedRoomId,
api::{request, response},
metadata,
};
use serde_json::value::RawValue as RawJsonValue;
use crate::{authentication::ServerSignatures, membership::RawStrippedState};
metadata! {
method: PUT,
rate_limited: false,
authentication: ServerSignatures,
path: "/_matrix/federation/v1/send_knock/{room_id}/{event_id}",
}
#[request]
pub struct Request {
#[ruma_api(path)]
pub room_id: OwnedRoomId,
#[ruma_api(path)]
pub event_id: OwnedEventId,
#[ruma_api(body)]
pub pdu: Box<RawJsonValue>,
}
#[response]
pub struct Response {
pub knock_room_state: Vec<RawStrippedState>,
}
impl Request {
pub fn new(room_id: OwnedRoomId, event_id: OwnedEventId, pdu: Box<RawJsonValue>) -> Self {
Self { room_id, event_id, pdu }
}
}
impl Response {
pub fn new(knock_room_state: Vec<RawStrippedState>) -> Self {
Self { knock_room_state }
}
}