pub mod v3 {
use ruma_common::{
api::{request, response, Metadata},
metadata, OwnedEventId, OwnedRoomId,
};
const METADATA: Metadata = metadata! {
method: POST,
rate_limited: true,
authentication: AccessToken,
history: {
1.0 => "/_matrix/client/r0/rooms/:room_id/read_markers",
1.1 => "/_matrix/client/v3/rooms/:room_id/read_markers",
}
};
#[request(error = crate::Error)]
pub struct Request {
#[ruma_api(path)]
pub room_id: OwnedRoomId,
#[serde(rename = "m.fully_read", skip_serializing_if = "Option::is_none")]
pub fully_read: Option<OwnedEventId>,
#[serde(rename = "m.read", skip_serializing_if = "Option::is_none")]
pub read_receipt: Option<OwnedEventId>,
#[serde(rename = "m.read.private", skip_serializing_if = "Option::is_none")]
pub private_read_receipt: Option<OwnedEventId>,
}
#[response(error = crate::Error)]
#[derive(Default)]
pub struct Response {}
impl Request {
pub fn new(room_id: OwnedRoomId) -> Self {
Self { room_id, fully_read: None, read_receipt: None, private_read_receipt: None }
}
}
impl Response {
pub fn new() -> Self {
Self {}
}
}
}