use ruma_common::{
api::{request, response, Metadata},
metadata, OwnedEventId, OwnedRoomId,
};
use serde::{Deserialize, Serialize};
use serde_json::value::RawValue as RawJsonValue;
const METADATA: Metadata = metadata! {
method: PUT,
rate_limited: false,
authentication: ServerSignatures,
history: {
1.0 => "/_matrix/federation/v1/send_leave/:room_id/:event_id",
1.0 => deprecated,
}
};
#[request]
#[deprecated = "Since Matrix Server-Server API r0.1.4. Use the v2 endpoint instead."]
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]
#[derive(Default)]
#[deprecated = "Since Matrix Server-Server API r0.1.4. Use the v2 endpoint instead."]
pub struct Response {
#[ruma_api(body)]
#[serde(with = "crate::serde::v1_pdu")]
pub empty: Empty,
}
#[allow(deprecated)]
impl Request {
pub fn new(room_id: OwnedRoomId, event_id: OwnedEventId, pdu: Box<RawJsonValue>) -> Self {
Self { room_id, event_id, pdu }
}
}
#[allow(deprecated)]
impl Response {
pub fn new() -> Self {
Self { empty: Empty {} }
}
}
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[allow(clippy::exhaustive_structs)]
pub struct Empty {}
impl Empty {
pub fn new() -> Self {
Self {}
}
}