pub mod v1 {
use js_int::UInt;
use ruma_common::{
MilliSecondsSinceUnixEpoch, OwnedEventId, OwnedRoomId, OwnedServerName,
api::{request, response},
metadata,
};
use serde_json::value::RawValue as RawJsonValue;
use crate::authentication::ServerSignatures;
metadata! {
method: GET,
rate_limited: false,
authentication: ServerSignatures,
path: "/_matrix/federation/v1/backfill/{room_id}",
}
#[request]
pub struct Request {
#[ruma_api(path)]
pub room_id: OwnedRoomId,
#[ruma_api(query)]
pub v: Vec<OwnedEventId>,
#[ruma_api(query)]
pub limit: UInt,
}
#[response]
pub struct Response {
pub origin: OwnedServerName,
pub origin_server_ts: MilliSecondsSinceUnixEpoch,
pub pdus: Vec<Box<RawJsonValue>>,
}
impl Request {
pub fn new(room_id: OwnedRoomId, v: Vec<OwnedEventId>, limit: UInt) -> Self {
Self { room_id, v, limit }
}
}
impl Response {
pub fn new(
origin: OwnedServerName,
origin_server_ts: MilliSecondsSinceUnixEpoch,
pdus: Vec<Box<RawJsonValue>>,
) -> Self {
Self { origin, origin_server_ts, pdus }
}
}
}