pub mod v3 {
use std::collections::BTreeMap;
use ruma_common::{
api::{request, response, Metadata},
metadata,
thirdparty::Location,
};
const METADATA: Metadata = metadata! {
method: GET,
rate_limited: false,
authentication: AccessToken,
history: {
1.0 => "/_matrix/client/r0/thirdparty/location/:protocol",
1.1 => "/_matrix/client/v3/thirdparty/location/:protocol",
}
};
#[request(error = crate::Error)]
pub struct Request {
#[ruma_api(path)]
pub protocol: String,
#[ruma_api(query_map)]
pub fields: BTreeMap<String, String>,
}
#[response(error = crate::Error)]
pub struct Response {
#[ruma_api(body)]
pub locations: Vec<Location>,
}
impl Request {
pub fn new(protocol: String) -> Self {
Self { protocol, fields: BTreeMap::new() }
}
}
impl Response {
pub fn new(locations: Vec<Location>) -> Self {
Self { locations }
}
}
}