Use ruma-api-macros for the voip endpoints.
This commit is contained in:
parent
0d9d1f8119
commit
863fe814ef
@ -42,7 +42,7 @@ pub mod r0 {
|
|||||||
pub mod sync;
|
pub mod sync;
|
||||||
pub mod tag;
|
pub mod tag;
|
||||||
pub mod typing;
|
pub mod typing;
|
||||||
// pub mod voip;
|
pub mod voip;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod unversioned;
|
pub mod unversioned;
|
||||||
|
@ -2,51 +2,29 @@
|
|||||||
|
|
||||||
/// [GET /_matrix/client/r0/voip/turnServer](https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-voip-turnserver)
|
/// [GET /_matrix/client/r0/voip/turnServer](https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-voip-turnserver)
|
||||||
pub mod get_turn_server_info {
|
pub mod get_turn_server_info {
|
||||||
/// Details about this API endpoint.
|
use ruma_api_macros::ruma_api;
|
||||||
#[derive(Clone, Copy, Debug)]
|
|
||||||
pub struct Endpoint;
|
|
||||||
|
|
||||||
/// This API endpoint's path parameters.
|
ruma_api! {
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
metadata {
|
||||||
pub struct Response {
|
description: "Get credentials for the client to use when initiating VoIP calls.",
|
||||||
pub username: String,
|
method: Method::Get,
|
||||||
|
name: "turn_server_info",
|
||||||
|
path: "_matrix/client/r0/voip/turnServer",
|
||||||
|
rate_limited: true,
|
||||||
|
requires_authentication: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
request {}
|
||||||
|
|
||||||
|
response {
|
||||||
|
/// The password to use.
|
||||||
pub password: String,
|
pub password: String,
|
||||||
|
/// The time-to-live in seconds.
|
||||||
|
pub ttl: u64,
|
||||||
|
/// A list of TURN URIs.
|
||||||
pub uris: Vec<String>,
|
pub uris: Vec<String>,
|
||||||
pub ttl: u64
|
/// The username to use.
|
||||||
}
|
pub username: String,
|
||||||
|
|
||||||
impl ::Endpoint for Endpoint {
|
|
||||||
type BodyParams = ();
|
|
||||||
type PathParams = ();
|
|
||||||
type QueryParams = ();
|
|
||||||
type Response = Response;
|
|
||||||
|
|
||||||
fn method() -> ::Method {
|
|
||||||
::Method::Get
|
|
||||||
}
|
|
||||||
|
|
||||||
fn request_path(_params: Self::PathParams) -> String {
|
|
||||||
Self::router_path().to_string()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn router_path() -> &'static str {
|
|
||||||
"_matrix/client/r0/voip/turnServer"
|
|
||||||
}
|
|
||||||
|
|
||||||
fn name() -> &'static str {
|
|
||||||
"turn_server_info"
|
|
||||||
}
|
|
||||||
|
|
||||||
fn description() -> &'static str {
|
|
||||||
"Get credentials for the client to use when initiating VoIP calls."
|
|
||||||
}
|
|
||||||
|
|
||||||
fn requires_authentication() -> bool {
|
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
fn rate_limited() -> bool {
|
|
||||||
true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user