pub mod v1 {
use std::collections::BTreeMap;
use ruma_common::{
api::{request, response},
metadata,
};
use serde_json::Value as JsonValue;
use crate::authentication::ServerSignatures;
metadata! {
method: GET,
rate_limited: false,
authentication: ServerSignatures,
path: "/_matrix/federation/v1/query/{query_type}",
}
#[request]
pub struct Request {
#[ruma_api(path)]
pub query_type: String,
#[ruma_api(query_all)]
pub params: BTreeMap<String, String>,
}
#[response]
pub struct Response {
#[ruma_api(body)]
pub body: JsonValue,
}
impl Request {
pub fn new(query_type: String, params: BTreeMap<String, String>) -> Self {
Self { query_type, params }
}
}
impl Response {
pub fn new(body: JsonValue) -> Self {
Self { body }
}
}
}