pub mod v3 {
use std::time::Duration;
use ruma_common::{
api::{request, response, Metadata},
metadata,
};
const METADATA: Metadata = metadata! {
method: GET,
rate_limited: true,
authentication: AccessToken,
history: {
1.0 => "/_matrix/client/r0/voip/turnServer",
1.1 => "/_matrix/client/v3/voip/turnServer",
}
};
#[request(error = crate::Error)]
#[derive(Default)]
pub struct Request {}
#[response(error = crate::Error)]
pub struct Response {
pub username: String,
pub password: String,
pub uris: Vec<String>,
#[serde(with = "ruma_common::serde::duration::secs")]
pub ttl: Duration,
}
impl Request {
pub fn new() -> Self {
Self {}
}
}
impl Response {
pub fn new(username: String, password: String, uris: Vec<String>, ttl: Duration) -> Self {
Self { username, password, uris, ttl }
}
}
}