Add get_username_availibility endpoint
This commit is contained in:
parent
806eec754b
commit
4a0e0e8bfe
@ -22,6 +22,7 @@ Improvements:
|
||||
* Add `r0::capabilities::get_capabilities` (introduced in r0.5.0)
|
||||
* Add `r0::keys` endpoints (introduced in r0.3.0)
|
||||
* Add `r0::session::get_login_types` (introduced in r0.4.0)
|
||||
* Add `r0::account::get_username_availability` (introduced in r0.4.0)
|
||||
|
||||
# 0.5.0
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
pub mod change_password;
|
||||
pub mod deactivate;
|
||||
pub mod get_username_availability;
|
||||
pub mod register;
|
||||
pub mod request_password_change_token;
|
||||
pub mod request_register_token;
|
||||
|
26
src/r0/account/get_username_availability.rs
Normal file
26
src/r0/account/get_username_availability.rs
Normal file
@ -0,0 +1,26 @@
|
||||
//! [GET /_matrix/client/r0/register/available](https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-register-available)
|
||||
|
||||
use ruma_api::ruma_api;
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
description: "Checks to see if a username is available, and valid, for the server.",
|
||||
method: GET,
|
||||
name: "get_username_availability",
|
||||
path: "/_matrix/client/r0/register/available",
|
||||
rate_limited: true,
|
||||
requires_authentication: false,
|
||||
}
|
||||
|
||||
request {
|
||||
/// The username to check the availability of.
|
||||
#[ruma_api(query)]
|
||||
pub username: String,
|
||||
}
|
||||
|
||||
response {
|
||||
/// A flag to indicate that the username is available.
|
||||
/// This should always be true when the server replies with 200 OK.
|
||||
pub available: bool
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user