api: Turn metadata name and description fields into docstrings
This commit is contained in:
parent
bdb5950fe4
commit
ae3394a6df
@ -38,9 +38,7 @@ pub mod v1 {
|
||||
use serde_json::{value::RawValue as RawJsonValue, Value as JsonValue};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "This API is called by the homeserver when it wants to push an event (or batch of events) to the application service.",
|
||||
method: PUT,
|
||||
name: "push_events",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -48,6 +46,7 @@ pub mod v1 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `push_events` endpoint.
|
||||
#[request]
|
||||
pub struct Request<'a> {
|
||||
/// The transaction ID for this set of events.
|
||||
@ -109,6 +108,7 @@ pub mod v1 {
|
||||
pub to_device: &'a [Raw<AnyToDeviceEvent>],
|
||||
}
|
||||
|
||||
/// Response type for the `push_events` endpoint.
|
||||
#[response]
|
||||
#[derive(Default)]
|
||||
pub struct Response {}
|
||||
|
@ -5,7 +5,7 @@
|
||||
//!
|
||||
//! [appservice-api]: https://spec.matrix.org/v1.4/application-service-api/
|
||||
|
||||
// #![warn(missing_docs)] FIXME
|
||||
#![warn(missing_docs)]
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
|
@ -13,9 +13,7 @@ pub mod v1 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "This endpoint is invoked by the homeserver on an application service to query the existence of a given room alias.",
|
||||
method: GET,
|
||||
name: "query_room_alias",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -23,6 +21,7 @@ pub mod v1 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `query_room_alias` endpoint.
|
||||
#[request]
|
||||
pub struct Request<'a> {
|
||||
/// The room alias being queried.
|
||||
@ -30,6 +29,7 @@ pub mod v1 {
|
||||
pub room_alias: &'a RoomAliasId,
|
||||
}
|
||||
|
||||
/// Response type for the `query_room_alias` endpoint.
|
||||
#[response]
|
||||
#[derive(Default)]
|
||||
pub struct Response {}
|
||||
|
@ -13,9 +13,7 @@ pub mod v1 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "This endpoint is invoked by the homeserver on an application service to query the existence of a given user ID.",
|
||||
method: GET,
|
||||
name: "query_user_id",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -23,6 +21,7 @@ pub mod v1 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `query_user_id` endpoint.
|
||||
#[request]
|
||||
pub struct Request<'a> {
|
||||
/// The user ID being queried.
|
||||
@ -30,6 +29,7 @@ pub mod v1 {
|
||||
pub user_id: &'a UserId,
|
||||
}
|
||||
|
||||
/// Response type for the `query_user_id` endpoint.
|
||||
#[response]
|
||||
#[derive(Default)]
|
||||
pub struct Response {}
|
||||
|
@ -1,7 +1,6 @@
|
||||
//! `GET /_matrix/app/*/thirdparty/location/{protocol}`
|
||||
//!
|
||||
//! Endpoint to retrieve a list of Matrix portal rooms that lead to the matched third party
|
||||
//! location.
|
||||
//! Retrieve a list of Matrix portal rooms that lead to the matched third party location.
|
||||
|
||||
pub mod v1 {
|
||||
//! `/v1/` ([spec])
|
||||
@ -17,9 +16,7 @@ pub mod v1 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Fetches third party locations for a protocol.",
|
||||
method: GET,
|
||||
name: "get_location_for_protocol",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -27,6 +24,7 @@ pub mod v1 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_location_for_protocol` endpoint.
|
||||
#[request]
|
||||
pub struct Request<'a> {
|
||||
/// The protocol used to communicate to the third party network.
|
||||
@ -39,6 +37,7 @@ pub mod v1 {
|
||||
pub fields: BTreeMap<String, String>,
|
||||
}
|
||||
|
||||
/// Response type for the `get_location_for_protocol` endpoint.
|
||||
#[response]
|
||||
pub struct Response {
|
||||
/// List of matched third party locations.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//! `GET /_matrix/app/*/thirdparty/location`
|
||||
//!
|
||||
//! Endpoint to retrieve an array of third party network locations from a Matrix room alias.
|
||||
//! Retrieve an array of third party network locations from a Matrix room alias.
|
||||
|
||||
pub mod v1 {
|
||||
//! `/v1/` ([spec])
|
||||
@ -15,9 +15,7 @@ pub mod v1 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Retrieve an array of third party network locations from a Matrix room alias.",
|
||||
method: GET,
|
||||
name: "get_location_for_room_alias",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -25,6 +23,7 @@ pub mod v1 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_location_for_room_alias` endpoint.
|
||||
#[request]
|
||||
pub struct Request<'a> {
|
||||
/// The Matrix room alias to look up.
|
||||
@ -32,6 +31,7 @@ pub mod v1 {
|
||||
pub alias: &'a RoomAliasId,
|
||||
}
|
||||
|
||||
/// Response type for the `get_location_for_room_alias` endpoint.
|
||||
#[response]
|
||||
pub struct Response {
|
||||
/// List of matched third party locations.
|
||||
|
@ -1,7 +1,6 @@
|
||||
//! `GET /_matrix/app/*/thirdparty/protocol/{protocol}`
|
||||
//!
|
||||
//! Endpoint to present clients with specific information about the various third party networks
|
||||
//! that an application service supports.
|
||||
//! Fetches metadata about the various third party networks that an application service supports.
|
||||
|
||||
pub mod v1 {
|
||||
//! `/v1/` ([spec])
|
||||
@ -15,9 +14,7 @@ pub mod v1 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Fetches the metadata from the homeserver about a particular third party protocol.",
|
||||
method: GET,
|
||||
name: "get_protocol",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -25,6 +22,7 @@ pub mod v1 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_protocol` endpoint.
|
||||
#[request]
|
||||
pub struct Request<'a> {
|
||||
/// The name of the protocol.
|
||||
@ -32,6 +30,7 @@ pub mod v1 {
|
||||
pub protocol: &'a str,
|
||||
}
|
||||
|
||||
/// Response type for the `get_protocol` endpoint.
|
||||
#[response]
|
||||
pub struct Response {
|
||||
/// Metadata about the protocol.
|
||||
|
@ -1,7 +1,7 @@
|
||||
//! `GET /_matrix/app/*/thirdparty/user/{protocol}`
|
||||
//!
|
||||
//! Endpoint to retrieve a Matrix User ID linked to a user on the third party network, given a set
|
||||
//! of user parameters.
|
||||
//! Retrieve a Matrix User ID linked to a user on the third party network, given a set of user
|
||||
//! parameters.
|
||||
|
||||
pub mod v1 {
|
||||
//! `/v1/` ([spec])
|
||||
@ -17,9 +17,7 @@ pub mod v1 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Fetches third party users for a protocol.",
|
||||
method: GET,
|
||||
name: "get_user_for_protocol",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -27,6 +25,7 @@ pub mod v1 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_user_for_protocol` endpoint.
|
||||
#[request]
|
||||
pub struct Request<'a> {
|
||||
/// The protocol used to communicate to the third party network.
|
||||
@ -39,6 +38,7 @@ pub mod v1 {
|
||||
pub fields: BTreeMap<String, String>,
|
||||
}
|
||||
|
||||
/// Response type for the `get_user_for_protocol` endpoint.
|
||||
#[response]
|
||||
pub struct Response {
|
||||
/// List of matched third party users.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//! `GET /_matrix/app/*/thirdparty/user`
|
||||
//!
|
||||
//! Endpoint to retrieve an array of third party users from a Matrix User ID.
|
||||
//! Retrieve an array of third party users from a Matrix User ID.
|
||||
|
||||
pub mod v1 {
|
||||
//! `/v1/` ([spec])
|
||||
@ -15,9 +15,7 @@ pub mod v1 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Retrieve an array of third party users from a Matrix User ID.",
|
||||
method: GET,
|
||||
name: "get_user_for_user_id",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -25,6 +23,7 @@ pub mod v1 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_user_for_user_id` endpoint.
|
||||
#[request]
|
||||
pub struct Request<'a> {
|
||||
/// The Matrix User ID to look up.
|
||||
@ -32,6 +31,7 @@ pub mod v1 {
|
||||
pub userid: &'a UserId,
|
||||
}
|
||||
|
||||
/// Response type for the `get_user_for_user_id` endpoint.
|
||||
#[response]
|
||||
pub struct Response {
|
||||
/// List of matched third party users.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/account/3pid/add`
|
||||
//!
|
||||
//! Add contact information to a user's account
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -13,9 +15,7 @@ pub mod v3 {
|
||||
use crate::uiaa::{AuthData, IncomingAuthData, UiaaResponse};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Add contact information to a user's account",
|
||||
method: POST,
|
||||
name: "add_3pid",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -24,6 +24,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `add_3pid` endpoint.
|
||||
#[request(error = UiaaResponse)]
|
||||
pub struct Request<'a> {
|
||||
/// Additional information for the User-Interactive Authentication API.
|
||||
@ -37,6 +38,7 @@ pub mod v3 {
|
||||
pub sid: &'a SessionId,
|
||||
}
|
||||
|
||||
/// Response type for the `add_3pid` endpoint.
|
||||
#[response(error = UiaaResponse)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {}
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/account/3pid/bind`
|
||||
//!
|
||||
//! Bind a 3PID to a user's account on an identity server
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -13,9 +15,7 @@ pub mod v3 {
|
||||
use crate::account::{IdentityServerInfo, IncomingIdentityServerInfo};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Bind a 3PID to a user's account on an identity server",
|
||||
method: POST,
|
||||
name: "bind_3pid",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -24,6 +24,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `bind_3pid` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// Client-generated secret string used to protect this session.
|
||||
@ -38,6 +39,7 @@ pub mod v3 {
|
||||
pub sid: &'a SessionId,
|
||||
}
|
||||
|
||||
/// Response type for the `bind_3pid` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {}
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/account/password`
|
||||
//!
|
||||
//! Change the password of the current user's account.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -13,9 +15,7 @@ pub mod v3 {
|
||||
use crate::uiaa::{AuthData, IncomingAuthData, UiaaResponse};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Change the password of the current user's account.",
|
||||
method: POST,
|
||||
name: "change_password",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -24,6 +24,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `change_password` endpoint.
|
||||
#[request(error = UiaaResponse)]
|
||||
pub struct Request<'a> {
|
||||
/// The new password for the account.
|
||||
@ -47,6 +48,7 @@ pub mod v3 {
|
||||
pub auth: Option<AuthData<'a>>,
|
||||
}
|
||||
|
||||
/// Response type for the `change_password` endpoint.
|
||||
#[response(error = UiaaResponse)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {}
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/client/*/register/m.login.registration_token/validity`
|
||||
//!
|
||||
//! Checks to see if the given registration token is valid.
|
||||
|
||||
pub mod v1 {
|
||||
//! `/v1/` ([spec])
|
||||
@ -11,9 +13,7 @@ pub mod v1 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Checks to see if the given registration token is valid.",
|
||||
method: GET,
|
||||
name: "check_registration_token_validity",
|
||||
rate_limited: true,
|
||||
authentication: None,
|
||||
history: {
|
||||
@ -22,6 +22,7 @@ pub mod v1 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `check_registration_token_validity` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The registration token to check the validity of.
|
||||
@ -29,6 +30,7 @@ pub mod v1 {
|
||||
pub registration_token: &'a str,
|
||||
}
|
||||
|
||||
/// Response type for the `check_registration_token_validity` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// A flag to indicate that the registration token is valid.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/account/deactivate`
|
||||
//!
|
||||
//! Deactivate the current user's account.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -16,9 +18,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Deactivate the current user's account.",
|
||||
method: POST,
|
||||
name: "deactivate",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -27,6 +27,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `deactivate` endpoint.
|
||||
#[request(error = UiaaResponse)]
|
||||
#[derive(Default)]
|
||||
pub struct Request<'a> {
|
||||
@ -40,6 +41,7 @@ pub mod v3 {
|
||||
pub id_server: Option<&'a str>,
|
||||
}
|
||||
|
||||
/// Response type for the `deactivate` endpoint.
|
||||
#[response(error = UiaaResponse)]
|
||||
pub struct Response {
|
||||
/// Result of unbind operation.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! POST /_matrix/client/*/account/3pid/delete
|
||||
//!
|
||||
//! Delete a 3PID from a user's account on an identity server.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -14,9 +16,7 @@ pub mod v3 {
|
||||
use crate::account::ThirdPartyIdRemovalStatus;
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Delete a 3PID from a user's account on an identity server.",
|
||||
method: POST,
|
||||
name: "delete_3pid",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -25,6 +25,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `delete_3pid` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// Identity server to delete from.
|
||||
@ -38,6 +39,7 @@ pub mod v3 {
|
||||
pub address: &'a str,
|
||||
}
|
||||
|
||||
/// Response type for the `delete_3pid` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// Result of unbind operation.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/client/*/account/3pid`
|
||||
//!
|
||||
//! Get a list of 3rd party contacts associated with the user's account.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -12,9 +14,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Get a list of 3rd party contacts associated with the user's account.",
|
||||
method: GET,
|
||||
name: "get_3pids",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -23,10 +23,12 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_3pids` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Request {}
|
||||
|
||||
/// Response type for the `get_3pids` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// A list of third party identifiers the homeserver has associated with the user's
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/client/*/register/available`
|
||||
//!
|
||||
//! Checks to see if a username is available, and valid, for the server.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -11,9 +13,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Checks to see if a username is available, and valid, for the server.",
|
||||
method: GET,
|
||||
name: "get_username_availability",
|
||||
rate_limited: true,
|
||||
authentication: None,
|
||||
history: {
|
||||
@ -22,6 +22,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_username_availability` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The username to check the availability of.
|
||||
@ -29,6 +30,7 @@ pub mod v3 {
|
||||
pub username: &'a str,
|
||||
}
|
||||
|
||||
/// Response type for the `get_username_availability` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// A flag to indicate that the username is available.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/register`
|
||||
//!
|
||||
//! Register an account on this homeserver.
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
@ -18,9 +20,7 @@ pub mod v3 {
|
||||
use crate::uiaa::{AuthData, IncomingAuthData, UiaaResponse};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Register an account on this homeserver.",
|
||||
method: POST,
|
||||
name: "register",
|
||||
rate_limited: true,
|
||||
authentication: None,
|
||||
history: {
|
||||
@ -29,6 +29,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `register` endpoint.
|
||||
#[request(error = UiaaResponse)]
|
||||
#[derive(Default)]
|
||||
pub struct Request<'a> {
|
||||
@ -95,6 +96,7 @@ pub mod v3 {
|
||||
pub refresh_token: bool,
|
||||
}
|
||||
|
||||
/// Response type for the `register` endpoint.
|
||||
#[response(error = UiaaResponse)]
|
||||
pub struct Response {
|
||||
/// An access token for the account.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/account/3pid/email/requestToken`
|
||||
//!
|
||||
//! Request a 3PID management token with a 3rd party email.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -14,9 +16,7 @@ pub mod v3 {
|
||||
use crate::account::{IdentityServerInfo, IncomingIdentityServerInfo};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Request a 3PID management token with a 3rd party email.",
|
||||
method: POST,
|
||||
name: "request_3pid_management_token_via_email",
|
||||
rate_limited: false,
|
||||
authentication: None,
|
||||
history: {
|
||||
@ -25,6 +25,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `request_3pid_management_token_via_email` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// Client-generated secret string used to protect this session.
|
||||
@ -47,6 +48,7 @@ pub mod v3 {
|
||||
pub identity_server_info: Option<IdentityServerInfo<'a>>,
|
||||
}
|
||||
|
||||
/// Response type for the `request_3pid_management_token_via_email` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// The session identifier given by the identity server.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/account/3pid/msisdn/requestToken`
|
||||
//!
|
||||
//! Request a 3PID management token with a phone number.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -14,9 +16,7 @@ pub mod v3 {
|
||||
use crate::account::{IdentityServerInfo, IncomingIdentityServerInfo};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Request a 3PID management token with a phone number.",
|
||||
method: POST,
|
||||
name: "request_3pid_management_token_via_msisdn",
|
||||
rate_limited: false,
|
||||
authentication: None,
|
||||
history: {
|
||||
@ -25,6 +25,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `request_3pid_management_token_via_msisdn` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// Client-generated secret string used to protect this session.
|
||||
@ -50,6 +51,7 @@ pub mod v3 {
|
||||
pub identity_server_info: Option<IdentityServerInfo<'a>>,
|
||||
}
|
||||
|
||||
/// Response type for the `request_3pid_management_token_via_msisdn` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// The session identifier given by the identity server.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/user/{userId}/openid/request_token`
|
||||
//!
|
||||
//! Request an OpenID 1.0 token to verify identity with a third party.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -14,9 +16,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Request an OpenID 1.0 token to verify identity with a third party.",
|
||||
method: POST,
|
||||
name: "request_openid_token",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -25,6 +25,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `request_openid_token` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// User ID of authenticated user.
|
||||
@ -32,6 +33,7 @@ pub mod v3 {
|
||||
pub user_id: &'a UserId,
|
||||
}
|
||||
|
||||
/// Response type for the `request_openid_token` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// Access token for verifying user's identity.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/account/password/email/requestToken`
|
||||
//!
|
||||
//! Request that a password change token is sent to the given email address.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -14,9 +16,7 @@ pub mod v3 {
|
||||
use crate::account::{IdentityServerInfo, IncomingIdentityServerInfo};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Request that a password change token is sent to the given email address.",
|
||||
method: POST,
|
||||
name: "request_password_change_token_via_email",
|
||||
rate_limited: false,
|
||||
authentication: None,
|
||||
history: {
|
||||
@ -25,6 +25,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `request_password_change_token_via_email` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// Client-generated secret string used to protect this session.
|
||||
@ -47,6 +48,7 @@ pub mod v3 {
|
||||
pub identity_server_info: Option<IdentityServerInfo<'a>>,
|
||||
}
|
||||
|
||||
/// Response type for the `request_password_change_token_via_email` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// The session identifier given by the identity server.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/account/password/msisdn/requestToken`
|
||||
//!
|
||||
//! Request that a password change token is sent to the given phone number.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -12,9 +14,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Request that a password change token is sent to the given phone number.",
|
||||
method: POST,
|
||||
name: "request_password_change_token_via_msisdn",
|
||||
rate_limited: false,
|
||||
authentication: None,
|
||||
history: {
|
||||
@ -23,6 +23,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `request_password_change_token_via_msisdn` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// Client-generated secret string used to protect this session.
|
||||
@ -42,6 +43,7 @@ pub mod v3 {
|
||||
pub next_link: Option<&'a str>,
|
||||
}
|
||||
|
||||
/// Response type for the `request_password_change_token_via_msisdn` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// The session identifier given by the identity server.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/register/email/requestToken`
|
||||
//!
|
||||
//! Request a registration token with a 3rd party email.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -14,9 +16,7 @@ pub mod v3 {
|
||||
use crate::account::{IdentityServerInfo, IncomingIdentityServerInfo};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Request a registration token with a 3rd party email.",
|
||||
method: POST,
|
||||
name: "request_registration_token_via_email",
|
||||
rate_limited: false,
|
||||
authentication: None,
|
||||
history: {
|
||||
@ -25,6 +25,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `request_registration_token_via_email` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// Client-generated secret string used to protect this session.
|
||||
@ -47,6 +48,7 @@ pub mod v3 {
|
||||
pub identity_server_info: Option<IdentityServerInfo<'a>>,
|
||||
}
|
||||
|
||||
/// Response type for the `request_registration_token_via_email` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// The session identifier given by the identity server.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/register/msisdn/requestToken`
|
||||
//!
|
||||
//! Request a registration token with a phone number.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -14,9 +16,7 @@ pub mod v3 {
|
||||
use crate::account::{IdentityServerInfo, IncomingIdentityServerInfo};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Request a registration token with a phone number.",
|
||||
method: POST,
|
||||
name: "request_registration_token_via_msisdn",
|
||||
rate_limited: false,
|
||||
authentication: None,
|
||||
history: {
|
||||
@ -25,6 +25,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `request_registration_token_via_msisdn` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// Client-generated secret string used to protect this session.
|
||||
@ -50,6 +51,7 @@ pub mod v3 {
|
||||
pub identity_server_info: Option<IdentityServerInfo<'a>>,
|
||||
}
|
||||
|
||||
/// Response type for the `request_registration_token_via_msisdn` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// The session identifier given by the identity server.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/account/3pid/unbind`
|
||||
//!
|
||||
//! Unbind a 3PID from a user's account on an identity server.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -14,9 +16,7 @@ pub mod v3 {
|
||||
use crate::account::ThirdPartyIdRemovalStatus;
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Unbind a 3PID from a user's account on an identity server.",
|
||||
method: POST,
|
||||
name: "unbind_3pid",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -25,6 +25,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `unbind_3pid` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// Identity server to unbind from.
|
||||
@ -38,6 +39,7 @@ pub mod v3 {
|
||||
pub address: &'a str,
|
||||
}
|
||||
|
||||
/// Response type for the `unbind_3pid` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// Result of unbind operation.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/client/*/account/whoami`
|
||||
//!
|
||||
//! Get information about the owner of a given access token.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -11,9 +13,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Get information about the owner of a given access token.",
|
||||
method: GET,
|
||||
name: "whoami",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -22,10 +22,12 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `whoami` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Request {}
|
||||
|
||||
/// Response type for the `whoami` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// The id of the user that owns the access token.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `PUT /_matrix/client/*/directory/room/{roomAlias}`
|
||||
//!
|
||||
//! Add an alias to a room.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -11,9 +13,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Add an alias to a room.",
|
||||
method: PUT,
|
||||
name: "create_alias",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -22,6 +22,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `create_alias` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The room alias to set.
|
||||
@ -32,6 +33,7 @@ pub mod v3 {
|
||||
pub room_id: &'a RoomId,
|
||||
}
|
||||
|
||||
/// Response type for the `create_alias` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {}
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `DELETE /_matrix/client/*/directory/room/{roomAlias}`
|
||||
//!
|
||||
//! Remove an alias from a room.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -11,9 +13,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Remove an alias from a room.",
|
||||
method: DELETE,
|
||||
name: "delete_alias",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -22,6 +22,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `delete_alias` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The room alias to remove.
|
||||
@ -29,6 +30,7 @@ pub mod v3 {
|
||||
pub room_alias: &'a RoomAliasId,
|
||||
}
|
||||
|
||||
/// Response type for the `delete_alias` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {}
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/client/*/directory/room/{roomAlias}`
|
||||
//!
|
||||
//! Resolve a room alias to a room ID.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -11,9 +13,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Resolve a room alias to a room ID.",
|
||||
method: GET,
|
||||
name: "get_alias",
|
||||
rate_limited: false,
|
||||
authentication: None,
|
||||
history: {
|
||||
@ -22,6 +22,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_alias` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The room alias.
|
||||
@ -29,6 +30,7 @@ pub mod v3 {
|
||||
pub room_alias: &'a RoomAliasId,
|
||||
}
|
||||
|
||||
/// Response type for the `get_alias` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// The room ID for this room alias.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `PUT /_matrix/client/*/directory/list/appservice/{networkId}/{roomId}`
|
||||
//!
|
||||
//! Updates the visibility of a given room on the application service's room directory.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -13,9 +15,7 @@ pub mod v3 {
|
||||
use crate::room::Visibility;
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Updates the visibility of a given room on the application service's room directory.",
|
||||
method: PUT,
|
||||
name: "set_room_visibility",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -24,6 +24,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `set_room_visibility` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The protocol (network) ID to update the room list for.
|
||||
@ -38,6 +39,7 @@ pub mod v3 {
|
||||
pub visibility: Visibility,
|
||||
}
|
||||
|
||||
/// Response type for the `set_room_visibility` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {}
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `PUT /_matrix/client/*/room_keys/keys`
|
||||
//!
|
||||
//! Store keys in the backup.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -16,9 +18,7 @@ pub mod v3 {
|
||||
use crate::backup::RoomKeyBackup;
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Store keys in the backup.",
|
||||
method: PUT,
|
||||
name: "add_backup_keys",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -27,6 +27,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `add_backup_keys` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The backup version to add keys to.
|
||||
@ -39,6 +40,7 @@ pub mod v3 {
|
||||
pub rooms: BTreeMap<OwnedRoomId, RoomKeyBackup>,
|
||||
}
|
||||
|
||||
/// Response type for the `add_backup_keys` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// An opaque string representing stored keys in the backup.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `PUT /_matrix/client/*/room_keys/keys/{roomId}`
|
||||
//!
|
||||
//! Store keys in the backup for a room.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -18,9 +20,7 @@ pub mod v3 {
|
||||
use crate::backup::KeyBackupData;
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Store keys in the backup for a room.",
|
||||
method: PUT,
|
||||
name: "add_backup_keys_for_room",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -30,6 +30,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `add_backup_keys_for_room` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The backup version to add keys to.
|
||||
@ -46,6 +47,7 @@ pub mod v3 {
|
||||
pub sessions: BTreeMap<String, Raw<KeyBackupData>>,
|
||||
}
|
||||
|
||||
/// Response type for the `add_backup_keys_for_room` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// An opaque string representing stored keys in the backup.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `PUT /_matrix/client/*/room_keys/keys/{roomId}/{sessionId}`
|
||||
//!
|
||||
//! Store keys in the backup for a session.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -16,9 +18,7 @@ pub mod v3 {
|
||||
use crate::backup::KeyBackupData;
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Store keys in the backup for a session.",
|
||||
method: PUT,
|
||||
name: "add_backup_keys_for_session",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -28,6 +28,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `add_backup_keys_for_session` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The backup version to add keys to.
|
||||
@ -49,6 +50,7 @@ pub mod v3 {
|
||||
pub session_data: Raw<KeyBackupData>,
|
||||
}
|
||||
|
||||
/// Response type for the `add_backup_keys_for_session` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// An opaque string representing stored keys in the backup.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/room_keys/version`
|
||||
//!
|
||||
//! Create a new backup version.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -14,9 +16,7 @@ pub mod v3 {
|
||||
use crate::backup::BackupAlgorithm;
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Create a new backup version.",
|
||||
method: POST,
|
||||
name: "create_backup_version",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -25,6 +25,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `create_backup_version` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request {
|
||||
/// The algorithm used for storing backups.
|
||||
@ -32,6 +33,7 @@ pub mod v3 {
|
||||
pub algorithm: Raw<BackupAlgorithm>,
|
||||
}
|
||||
|
||||
/// Response type for the `create_backup_version` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// The backup version.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `DELETE /_matrix/client/*/room_keys/keys`
|
||||
//!
|
||||
//! Delete all keys from a backup.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -14,9 +16,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Delete all keys from a backup.",
|
||||
method: DELETE,
|
||||
name: "delete_backup_keys",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -26,6 +26,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `delete_backup_keys` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The backup version from which to delete keys.
|
||||
@ -33,6 +34,7 @@ pub mod v3 {
|
||||
pub version: &'a str,
|
||||
}
|
||||
|
||||
/// Response type for the `delete_backup_keys` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// An opaque string representing stored keys in the backup.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `DELETE /_matrix/client/*/room_keys/keys/{roomId}`
|
||||
//!
|
||||
//! Delete keys from a backup for a given room.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -12,9 +14,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Delete keys from a backup for a given room.",
|
||||
method: DELETE,
|
||||
name: "delete_backup_keys_for_room",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -24,6 +24,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `delete_backup_keys_for_room` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The backup version from which to delete keys.
|
||||
@ -35,6 +36,7 @@ pub mod v3 {
|
||||
pub room_id: &'a RoomId,
|
||||
}
|
||||
|
||||
/// Response type for the `delete_backup_keys_for_room` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// An opaque string representing stored keys in the backup.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `DELETE /_matrix/client/*/room_keys/keys/{roomId}/{sessionId}`
|
||||
//!
|
||||
//! Delete keys from a backup for a given session.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -12,9 +14,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Delete keys from a backup for a given session.",
|
||||
method: DELETE,
|
||||
name: "delete_backup_keys_for_session",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -24,6 +24,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `delete_backup_keys_for_session` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The backup version from which to delete keys.
|
||||
@ -39,6 +40,7 @@ pub mod v3 {
|
||||
pub session_id: &'a str,
|
||||
}
|
||||
|
||||
/// Response type for the `delete_backup_keys_for_session` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// An opaque string representing stored keys in the backup.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `DELETE /_matrix/client/*/room_keys/version/{version}`
|
||||
//!
|
||||
//! Delete a backup version.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -13,9 +15,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Delete a backup version.",
|
||||
method: DELETE,
|
||||
name: "delete_backup_version",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -25,6 +25,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `delete_backup_version` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The backup version to delete.
|
||||
@ -32,6 +33,7 @@ pub mod v3 {
|
||||
pub version: &'a str,
|
||||
}
|
||||
|
||||
/// Response type for the `delete_backup_version` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {}
|
||||
|
@ -19,9 +19,7 @@ pub mod v3 {
|
||||
use crate::backup::BackupAlgorithm;
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Get information about a specific backup.",
|
||||
method: GET,
|
||||
name: "get_backup_info",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -30,6 +28,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_backup_info` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The backup version to retrieve info from.
|
||||
@ -37,6 +36,7 @@ pub mod v3 {
|
||||
pub version: &'a str,
|
||||
}
|
||||
|
||||
/// Response type for the `get_backup_info` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[ruma_api(manual_body_serde)]
|
||||
pub struct Response {
|
||||
|
@ -17,9 +17,7 @@ pub mod v3 {
|
||||
use crate::backup::RoomKeyBackup;
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Retrieve all keys from a backup version.",
|
||||
method: GET,
|
||||
name: "get_backup_keys",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -29,6 +27,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_backup_keys` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The backup version to retrieve keys from.
|
||||
@ -36,6 +35,7 @@ pub mod v3 {
|
||||
pub version: &'a str,
|
||||
}
|
||||
|
||||
/// Response type for the `get_backup_keys` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// A map from room IDs to session IDs to key data.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/client/*/room_keys/keys/{roomId}`
|
||||
//!
|
||||
//! Retrieve sessions from the backup for a given room.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -17,9 +19,7 @@ pub mod v3 {
|
||||
use crate::backup::KeyBackupData;
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Retrieve sessions from the backup for a given room.",
|
||||
method: GET,
|
||||
name: "get_backup_keys_for_room",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -29,6 +29,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_backup_keys_for_room` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The backup version to retrieve keys from.
|
||||
@ -40,6 +41,7 @@ pub mod v3 {
|
||||
pub room_id: &'a RoomId,
|
||||
}
|
||||
|
||||
/// Response type for the `get_backup_keys_for_room` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// A map of session IDs to key data.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/client/*/room_keys/keys/{roomId}/{sessionId}`
|
||||
//!
|
||||
//! Retrieve a key from the backup for a given session.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -15,9 +17,7 @@ pub mod v3 {
|
||||
use crate::backup::KeyBackupData;
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Retrieve a key from the backup for a given session.",
|
||||
method: GET,
|
||||
name: "get_backup_keys_for_session",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -27,6 +27,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_backup_keys_for_session` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The backup version to retrieve keys from.
|
||||
@ -42,6 +43,7 @@ pub mod v3 {
|
||||
pub session_id: &'a str,
|
||||
}
|
||||
|
||||
/// Response type for the `get_backup_keys_for_session` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// Information about the requested backup key.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/client/*/room_keys/version`
|
||||
//!
|
||||
//! Get information about the latest backup.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -20,9 +22,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Get information about the latest backup.",
|
||||
method: GET,
|
||||
name: "get_latest_backup_info",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -32,10 +32,12 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_latest_backup_info` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Request {}
|
||||
|
||||
/// Response type for the `get_latest_backup_info` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[ruma_api(manual_body_serde)]
|
||||
pub struct Response {
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `PUT /_matrix/client/*/room_keys/version/{version}`
|
||||
//!
|
||||
//! Update information about an existing backup.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -14,9 +16,7 @@ pub mod v3 {
|
||||
use crate::backup::BackupAlgorithm;
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Update information about an existing backup.",
|
||||
method: PUT,
|
||||
name: "update_backup_version",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -25,6 +25,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `update_backup_version` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The backup version.
|
||||
@ -36,6 +37,7 @@ pub mod v3 {
|
||||
pub algorithm: Raw<BackupAlgorithm>,
|
||||
}
|
||||
|
||||
/// Response type for the `update_backup_version` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {}
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/client/*/user/{userId}/account_data/{type}`
|
||||
//!
|
||||
//! Gets global account data for a user.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -14,9 +16,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Gets global account data for a user.",
|
||||
method: GET,
|
||||
name: "get_global_account_data",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -25,6 +25,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_global_account_data` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// User ID of user for whom to retrieve data.
|
||||
@ -36,6 +37,7 @@ pub mod v3 {
|
||||
pub event_type: &'a str,
|
||||
}
|
||||
|
||||
/// Response type for the `get_global_account_data` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// Account data content for the given type.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/client/*/user/{userId}/rooms/{roomId}/account_data/{type}`
|
||||
//!
|
||||
//! Gets account data room for a user for a given room
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -14,9 +16,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Gets account data room for a user for a given room",
|
||||
method: GET,
|
||||
name: "get_room_account_data",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -25,6 +25,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_room_account_data` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// User ID of user for whom to retrieve data.
|
||||
@ -40,6 +41,7 @@ pub mod v3 {
|
||||
pub event_type: &'a str,
|
||||
}
|
||||
|
||||
/// Response type for the `get_room_account_data` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// Account data content for the given type.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `PUT /_matrix/client/*/user/{userId}/account_data/{type}`
|
||||
//!
|
||||
//! Sets global account data.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -18,9 +20,7 @@ pub mod v3 {
|
||||
use serde_json::value::to_raw_value as to_raw_json_value;
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Sets global account data.",
|
||||
method: PUT,
|
||||
name: "set_global_account_data",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -29,6 +29,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `set_global_account_data` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The ID of the user to set account_data for.
|
||||
@ -50,6 +51,7 @@ pub mod v3 {
|
||||
pub data: Raw<AnyGlobalAccountDataEventContent>,
|
||||
}
|
||||
|
||||
/// Response type for the `set_global_account_data` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {}
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `PUT /_matrix/client/*/user/{userId}/rooms/{roomId}/account_data/{type}`
|
||||
//!
|
||||
//! Associate account data with a room.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -17,9 +19,7 @@ pub mod v3 {
|
||||
use serde_json::value::to_raw_value as to_raw_json_value;
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Associate account data with a room.",
|
||||
method: PUT,
|
||||
name: "set_room_account_data",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -28,6 +28,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `set_room_account_data` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The ID of the user to set account_data for.
|
||||
@ -53,6 +54,7 @@ pub mod v3 {
|
||||
pub data: Raw<AnyRoomAccountDataEventContent>,
|
||||
}
|
||||
|
||||
/// Response type for the `set_room_account_data` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {}
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/client/*/rooms/{roomId}/context/{eventId}`
|
||||
//!
|
||||
//! Get the events immediately preceding and following a given event.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -17,9 +19,7 @@ pub mod v3 {
|
||||
use crate::filter::{IncomingRoomEventFilter, RoomEventFilter};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Get the events immediately preceding and following a given event.",
|
||||
method: GET,
|
||||
name: "get_context",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -28,6 +28,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_context` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The room to get events from.
|
||||
@ -55,6 +56,7 @@ pub mod v3 {
|
||||
pub filter: RoomEventFilter<'a>,
|
||||
}
|
||||
|
||||
/// Response type for the `get_context` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `DELETE /_matrix/client/*/devices/{deviceId}`
|
||||
//!
|
||||
//! Delete a device for authenticated user.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -13,9 +15,7 @@ pub mod v3 {
|
||||
use crate::uiaa::{AuthData, IncomingAuthData, UiaaResponse};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Delete a device for authenticated user.",
|
||||
method: DELETE,
|
||||
name: "delete_device",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -24,6 +24,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `delete_device` endpoint.
|
||||
#[request(error = UiaaResponse)]
|
||||
pub struct Request<'a> {
|
||||
/// The device to delete.
|
||||
@ -35,6 +36,7 @@ pub mod v3 {
|
||||
pub auth: Option<AuthData<'a>>,
|
||||
}
|
||||
|
||||
/// Response type for the `delete_device` endpoint.
|
||||
#[response(error = UiaaResponse)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {}
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/delete_devices`
|
||||
//!
|
||||
//! Delete specified devices.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -13,9 +15,7 @@ pub mod v3 {
|
||||
use crate::uiaa::{AuthData, IncomingAuthData, UiaaResponse};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Delete specified devices.",
|
||||
method: POST,
|
||||
name: "delete_devices",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -24,6 +24,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `delete_devices` endpoint.
|
||||
#[request(error = UiaaResponse)]
|
||||
pub struct Request<'a> {
|
||||
/// List of devices to delete.
|
||||
@ -34,6 +35,7 @@ pub mod v3 {
|
||||
pub auth: Option<AuthData<'a>>,
|
||||
}
|
||||
|
||||
/// Response type for the `delete_devices` endpoint.
|
||||
#[response(error = UiaaResponse)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {}
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/client/*/devices/{deviceId}`
|
||||
//!
|
||||
//! Get a device for authenticated user.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -13,9 +15,7 @@ pub mod v3 {
|
||||
use crate::device::Device;
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Get a device for authenticated user.",
|
||||
method: GET,
|
||||
name: "get_device",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -24,6 +24,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_device` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The device to retrieve.
|
||||
@ -31,6 +32,7 @@ pub mod v3 {
|
||||
pub device_id: &'a DeviceId,
|
||||
}
|
||||
|
||||
/// Response type for the `get_device` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// Information about the device.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/client/*/devices`
|
||||
//!
|
||||
//! Get registered devices for authenticated user.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -13,9 +15,7 @@ pub mod v3 {
|
||||
use crate::device::Device;
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Get registered devices for authenticated user.",
|
||||
method: GET,
|
||||
name: "get_devices",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -24,10 +24,12 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_devices` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Request {}
|
||||
|
||||
/// Response type for the `get_devices` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// A list of all registered devices for this user
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `PUT /_matrix/client/*/devices/{deviceId}`
|
||||
//!
|
||||
//! Update metadata for a device.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -11,9 +13,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Update metadata for a device.",
|
||||
method: PUT,
|
||||
name: "update_device",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -22,6 +22,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `update_device` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The device to update.
|
||||
@ -35,6 +36,7 @@ pub mod v3 {
|
||||
pub display_name: Option<&'a str>,
|
||||
}
|
||||
|
||||
/// Response type for the `update_device` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {}
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/client/*/publicRooms`
|
||||
//!
|
||||
//! Get the list of rooms in this homeserver's public directory.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -13,9 +15,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Get the list of rooms in this homeserver's public directory.",
|
||||
method: GET,
|
||||
name: "get_public_rooms",
|
||||
rate_limited: false,
|
||||
authentication: None,
|
||||
history: {
|
||||
@ -24,6 +24,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_public_rooms` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Request<'a> {
|
||||
@ -45,6 +46,7 @@ pub mod v3 {
|
||||
pub server: Option<&'a ServerName>,
|
||||
}
|
||||
|
||||
/// Response type for the `get_public_rooms` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// A paginated chunk of public rooms.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/publicRooms`
|
||||
//!
|
||||
//! Get the list of rooms in this homeserver's public directory.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -13,9 +15,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Get the list of rooms in this homeserver's public directory.",
|
||||
method: POST,
|
||||
name: "get_public_rooms_filtered",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -24,6 +24,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_public_rooms_filtered` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Request<'a> {
|
||||
@ -51,6 +52,7 @@ pub mod v3 {
|
||||
pub room_network: RoomNetwork<'a>,
|
||||
}
|
||||
|
||||
/// Response type for the `get_public_rooms_filtered` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/client/*/directory/list/room/{roomId}`
|
||||
//!
|
||||
//! Get the visibility of a public room on a directory.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -13,9 +15,7 @@ pub mod v3 {
|
||||
use crate::room::Visibility;
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Get the visibility of a public room on a directory.",
|
||||
method: GET,
|
||||
name: "get_room_visibility",
|
||||
rate_limited: false,
|
||||
authentication: None,
|
||||
history: {
|
||||
@ -24,6 +24,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_room_visibility` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The ID of the room of which to request the visibility.
|
||||
@ -31,6 +32,7 @@ pub mod v3 {
|
||||
pub room_id: &'a RoomId,
|
||||
}
|
||||
|
||||
/// Response type for the `get_room_visibility` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// Visibility of the room.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `PUT /_matrix/client/*/directory/list/room/{roomId}`
|
||||
//!
|
||||
//! Set the visibility of a public room on a directory.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -13,9 +15,7 @@ pub mod v3 {
|
||||
use crate::room::Visibility;
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Set the visibility of a public room on a directory.",
|
||||
method: PUT,
|
||||
name: "set_room_visibility",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -24,6 +24,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `set_room_visibility` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The ID of the room of which to set the visibility.
|
||||
@ -34,6 +35,7 @@ pub mod v3 {
|
||||
pub visibility: Visibility,
|
||||
}
|
||||
|
||||
/// Response type for the `set_room_visibility` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {}
|
||||
|
@ -1,6 +1,8 @@
|
||||
//! `GET /.well-known/matrix/client` ([spec])
|
||||
//!
|
||||
//! [spec]: https://spec.matrix.org/v1.4/client-server-api/#getwell-knownmatrixclient
|
||||
//!
|
||||
//! Get discovery information about the domain.
|
||||
|
||||
use ruma_common::{
|
||||
api::{request, response, Metadata},
|
||||
@ -9,9 +11,7 @@ use ruma_common::{
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Get discovery information about the domain.",
|
||||
method: GET,
|
||||
name: "client_well_known",
|
||||
rate_limited: false,
|
||||
authentication: None,
|
||||
history: {
|
||||
@ -19,10 +19,12 @@ const METADATA: Metadata = metadata! {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `client_well_known` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Request {}
|
||||
|
||||
/// Response type for the `client_well_known` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// Information about the homeserver to connect to.
|
||||
|
@ -1,6 +1,7 @@
|
||||
//! `GET /_matrix/client/*/capabilities`
|
||||
//!
|
||||
//! Query the capabilities of a server ([spec])
|
||||
//! Get information about the server's supported feature set and other relevant capabilities
|
||||
//! ([spec]).
|
||||
//!
|
||||
//! [spec]: https://spec.matrix.org/unstable/client-server-api/#capabilities-negotiation
|
||||
|
||||
|
@ -10,9 +10,7 @@ use ruma_common::{
|
||||
use super::Capabilities;
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Gets information about the server's supported feature set and other relevant capabilities.",
|
||||
method: GET,
|
||||
name: "get_capabilities",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -21,10 +19,12 @@ const METADATA: Metadata = metadata! {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_capabilities` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Request {}
|
||||
|
||||
/// Response type for the `get_capabilities` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// The capabilities the server supports
|
||||
|
@ -1,5 +1,7 @@
|
||||
//! `GET /_matrix/client/versions` ([spec])
|
||||
//!
|
||||
//! Get the versions of the client-server API supported by this homeserver.
|
||||
//!
|
||||
//! [spec]: https://spec.matrix.org/v1.4/client-server-api/#get_matrixclientversions
|
||||
|
||||
use std::collections::BTreeMap;
|
||||
@ -10,9 +12,7 @@ use ruma_common::{
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Get the versions of the client-server API supported by this homeserver.",
|
||||
method: GET,
|
||||
name: "api_versions",
|
||||
rate_limited: false,
|
||||
authentication: None,
|
||||
history: {
|
||||
@ -20,10 +20,12 @@ const METADATA: Metadata = metadata! {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `api_versions` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Request {}
|
||||
|
||||
/// Response type for the `api_versions` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// A list of Matrix client API protocol versions supported by the homeserver.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/user/{userId}/filter`
|
||||
//!
|
||||
//! Create a new filter for event retrieval.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -13,9 +15,7 @@ pub mod v3 {
|
||||
use crate::filter::{FilterDefinition, IncomingFilterDefinition};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Create a new filter for event retrieval.",
|
||||
method: POST,
|
||||
name: "create_filter",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -24,6 +24,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `create_filter` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The ID of the user uploading the filter.
|
||||
@ -37,6 +38,7 @@ pub mod v3 {
|
||||
pub filter: FilterDefinition<'a>,
|
||||
}
|
||||
|
||||
/// Response type for the `create_filter` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// The ID of the filter that was created.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/client/*/user/{userId}/filter/{filterId}`
|
||||
//!
|
||||
//! Retrieve a previously created filter.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -13,9 +15,7 @@ pub mod v3 {
|
||||
use crate::filter::IncomingFilterDefinition;
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Retrieve a previously created filter.",
|
||||
method: GET,
|
||||
name: "get_filter",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -24,6 +24,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_filter` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The user ID to download a filter for.
|
||||
@ -35,6 +36,7 @@ pub mod v3 {
|
||||
pub filter_id: &'a str,
|
||||
}
|
||||
|
||||
/// Response type for the `get_filter` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// The filter definition.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/keys/claim`
|
||||
//!
|
||||
//! Claims one-time keys for use in pre-key messages.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -17,9 +19,7 @@ pub mod v3 {
|
||||
use serde_json::Value as JsonValue;
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Claims one-time keys for use in pre-key messages.",
|
||||
method: POST,
|
||||
name: "claim_keys",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -28,6 +28,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `claim_keys` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request {
|
||||
/// The time (in milliseconds) to wait when downloading keys from remote servers.
|
||||
@ -43,6 +44,7 @@ pub mod v3 {
|
||||
pub one_time_keys: BTreeMap<OwnedUserId, BTreeMap<OwnedDeviceId, DeviceKeyAlgorithm>>,
|
||||
}
|
||||
|
||||
/// Response type for the `claim_keys` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// If any remote homeservers could not be reached, they are recorded here.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/client/*/keys/changes`
|
||||
//!
|
||||
//! Gets a list of users who have updated their device identity keys since a previous sync token.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -11,9 +13,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Gets a list of users who have updated their device identity keys since a previous sync token.",
|
||||
method: GET,
|
||||
name: "get_key_changes",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -22,6 +22,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_key_changes` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The desired start point of the list.
|
||||
@ -38,6 +39,7 @@ pub mod v3 {
|
||||
pub to: &'a str,
|
||||
}
|
||||
|
||||
/// Response type for the `get_key_changes` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// The Matrix User IDs of all users who updated their device identity keys.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/keys/query`
|
||||
//!
|
||||
//! Returns the current devices and identity keys for the given users.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -17,9 +19,7 @@ pub mod v3 {
|
||||
use serde_json::Value as JsonValue;
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Returns the current devices and identity keys for the given users.",
|
||||
method: POST,
|
||||
name: "get_keys",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -28,6 +28,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_keys` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Request<'a> {
|
||||
@ -56,6 +57,7 @@ pub mod v3 {
|
||||
pub token: Option<&'a str>,
|
||||
}
|
||||
|
||||
/// Response type for the `get_keys` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/keys/upload`
|
||||
//!
|
||||
//! Publishes end-to-end encryption keys for the device.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -17,9 +19,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Publishes end-to-end encryption keys for the device.",
|
||||
method: POST,
|
||||
name: "upload_keys",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -28,6 +28,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `upload_keys` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Request {
|
||||
@ -46,6 +47,7 @@ pub mod v3 {
|
||||
pub fallback_keys: BTreeMap<OwnedDeviceKeyId, Raw<OneTimeKey>>,
|
||||
}
|
||||
|
||||
/// Response type for the `upload_keys` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// For each key algorithm, the number of unclaimed one-time keys of that
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/keys/signatures/upload`
|
||||
//!
|
||||
//! Publishes cross-signing signatures for the user.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -22,9 +24,7 @@ pub mod v3 {
|
||||
pub use super::iter::SignedKeysIter;
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Publishes cross-signing signatures for the user.",
|
||||
method: POST,
|
||||
name: "upload_signatures",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -33,6 +33,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `upload_signatures` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request {
|
||||
/// Signed keys.
|
||||
@ -40,6 +41,7 @@ pub mod v3 {
|
||||
pub signed_keys: BTreeMap<OwnedUserId, SignedKeys>,
|
||||
}
|
||||
|
||||
/// Response type for the `upload_signatures` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/keys/device_signing/upload`
|
||||
//!
|
||||
//! Publishes cross signing keys for the user.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -15,9 +17,7 @@ pub mod v3 {
|
||||
use crate::uiaa::{AuthData, IncomingAuthData, UiaaResponse};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Publishes cross signing keys for the user.",
|
||||
method: POST,
|
||||
name: "upload_signing_keys",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -26,6 +26,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `upload_signing_keys` endpoint.
|
||||
#[request(error = UiaaResponse)]
|
||||
#[derive(Default)]
|
||||
pub struct Request<'a> {
|
||||
@ -52,6 +53,7 @@ pub mod v3 {
|
||||
pub user_signing_key: Option<Raw<CrossSigningKey>>,
|
||||
}
|
||||
|
||||
/// Response type for the `upload_signing_keys` endpoint.
|
||||
#[response(error = UiaaResponse)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {}
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/knock/{roomIdOrAlias}`
|
||||
//!
|
||||
//! Knock on a room.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -11,9 +13,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Knock on a room.",
|
||||
method: POST,
|
||||
name: "knock_room",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -22,6 +22,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `knock_room` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The room the user should knock on.
|
||||
@ -40,6 +41,7 @@ pub mod v3 {
|
||||
pub server_name: &'a [OwnedServerName],
|
||||
}
|
||||
|
||||
/// Response type for the `knock_room` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// The room that the user knocked on.
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#![cfg(any(feature = "client", feature = "server"))]
|
||||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||
// #![warn(missing_docs)] FIXME
|
||||
#![warn(missing_docs)]
|
||||
|
||||
pub mod account;
|
||||
pub mod alias;
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/media/*/upload`
|
||||
//!
|
||||
//! Upload content to the media store.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -12,9 +14,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Upload content to the media store.",
|
||||
method: POST,
|
||||
name: "create_media_content",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -23,6 +23,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `create_media_content` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The file contents to upload.
|
||||
@ -52,6 +53,7 @@ pub mod v3 {
|
||||
pub generate_blurhash: bool,
|
||||
}
|
||||
|
||||
/// Response type for the `create_media_content` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// The MXC URI for the uploaded content.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/media/*/upload/{serverName}/{mediaId}`
|
||||
//!
|
||||
//! Upload media to an MXC URI that was created with create_mxc_uri.
|
||||
|
||||
pub mod unstable {
|
||||
//! `/unstable/` ([spec])
|
||||
@ -12,9 +14,7 @@ pub mod unstable {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Upload media to an MXC URI that was created with create_mxc_uri.",
|
||||
method: PUT,
|
||||
name: "create_content_async",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -22,6 +22,7 @@ pub mod unstable {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `create_content_async` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The server name from the mxc:// URI (the authoritory component).
|
||||
@ -42,6 +43,7 @@ pub mod unstable {
|
||||
// TODO: How does this and msc2448 (blurhash) interact?
|
||||
}
|
||||
|
||||
/// Response type for the `create_content_async` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {}
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/media/*/create`
|
||||
//!
|
||||
//! Create an MXC URI without content.
|
||||
|
||||
pub mod unstable {
|
||||
//! `/unstable/` ([spec])
|
||||
@ -12,9 +14,7 @@ pub mod unstable {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Create an MXC URI without content.",
|
||||
method: POST,
|
||||
name: "create_mxc_uri",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -22,10 +22,12 @@ pub mod unstable {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `create_mxc_uri` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Request {}
|
||||
|
||||
/// Response type for the `create_mxc_uri` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// The MXC URI for the about to be uploaded content.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/media/*/download/{serverName}/{mediaId}`
|
||||
//!
|
||||
//! Retrieve content from the media store.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -16,9 +18,7 @@ pub mod v3 {
|
||||
use crate::http_headers::CROSS_ORIGIN_RESOURCE_POLICY;
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Retrieve content from the media store.",
|
||||
method: GET,
|
||||
name: "get_media_content",
|
||||
rate_limited: false,
|
||||
authentication: None,
|
||||
history: {
|
||||
@ -27,6 +27,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_media_content` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The server name from the mxc:// URI (the authoritory component).
|
||||
@ -61,6 +62,7 @@ pub mod v3 {
|
||||
pub max_stall_ms: Option<UInt>,
|
||||
}
|
||||
|
||||
/// Response type for the `get_media_content` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// The content that was previously uploaded.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/media/*/download/{serverName}/{mediaId}/{fileName}`
|
||||
//!
|
||||
//! Retrieve content from the media store, specifying a filename to return.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -14,9 +16,7 @@ pub mod v3 {
|
||||
use crate::http_headers::CROSS_ORIGIN_RESOURCE_POLICY;
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Retrieve content from the media store, specifying a filename to return.",
|
||||
method: GET,
|
||||
name: "get_media_content_as_filename",
|
||||
rate_limited: false,
|
||||
authentication: None,
|
||||
history: {
|
||||
@ -25,6 +25,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_media_content_as_filename` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The server name from the mxc:// URI (the authoritory component).
|
||||
@ -50,6 +51,7 @@ pub mod v3 {
|
||||
pub allow_remote: bool,
|
||||
}
|
||||
|
||||
/// Response type for the `get_media_content_as_filename` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// The content that was previously uploaded.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/media/*/thumbnail/{serverName}/{mediaId}`
|
||||
//!
|
||||
//! Get a thumbnail of content from the media store.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -17,9 +19,7 @@ pub mod v3 {
|
||||
use crate::{http_headers::CROSS_ORIGIN_RESOURCE_POLICY, PrivOwnedStr};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Get a thumbnail of content from the media store.",
|
||||
method: GET,
|
||||
name: "get_content_thumbnail",
|
||||
rate_limited: true,
|
||||
authentication: None,
|
||||
history: {
|
||||
@ -28,6 +28,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_content_thumbnail` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The server name from the mxc:// URI (the authoritory component).
|
||||
@ -79,6 +80,7 @@ pub mod v3 {
|
||||
pub max_stall_ms: Option<UInt>,
|
||||
}
|
||||
|
||||
/// Response type for the `get_content_thumbnail` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// A thumbnail of the requested content.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/media/*/config`
|
||||
//!
|
||||
//! Gets the config for the media repository.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -12,9 +14,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Gets the config for the media repository.",
|
||||
method: GET,
|
||||
name: "get_media_config",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -23,10 +23,12 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_media_config` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Request {}
|
||||
|
||||
/// Response type for the `get_media_config` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// Maximum size of upload in bytes.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/media/*/preview_url`
|
||||
//!
|
||||
//! Get a preview for a URL.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -13,9 +15,7 @@ pub mod v3 {
|
||||
use serde_json::value::{to_raw_value as to_raw_json_value, RawValue as RawJsonValue};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Get a preview for a URL.",
|
||||
method: GET,
|
||||
name: "get_media_preview",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -24,6 +24,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_media_preview` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// URL to get a preview of.
|
||||
@ -35,6 +36,7 @@ pub mod v3 {
|
||||
pub ts: MilliSecondsSinceUnixEpoch,
|
||||
}
|
||||
|
||||
/// Response type for the `get_media_preview` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/rooms/{roomId}/ban`
|
||||
//!
|
||||
//! Ban a user from a room.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -11,9 +13,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Ban a user from a room.",
|
||||
method: POST,
|
||||
name: "ban_user",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -22,6 +22,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `ban_user` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The room to kick the user from.
|
||||
@ -36,6 +37,7 @@ pub mod v3 {
|
||||
pub reason: Option<&'a str>,
|
||||
}
|
||||
|
||||
/// Response type for the `ban_user` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {}
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/rooms/{roomId}/forget`
|
||||
//!
|
||||
//! Forget a room.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -11,9 +13,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Forget a room.",
|
||||
method: POST,
|
||||
name: "forget_room",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -22,6 +22,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `forget_room` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The room to forget.
|
||||
@ -29,6 +30,7 @@ pub mod v3 {
|
||||
pub room_id: &'a RoomId,
|
||||
}
|
||||
|
||||
/// Response type for the `forget_room` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {}
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/client/*/rooms/{roomId}/members`
|
||||
//!
|
||||
//! Get membership events for a room.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -16,9 +18,7 @@ pub mod v3 {
|
||||
use crate::PrivOwnedStr;
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Get membership events for a room.",
|
||||
method: GET,
|
||||
name: "get_member_events",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -27,6 +27,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_member_events` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The room to get the member events for.
|
||||
@ -58,6 +59,7 @@ pub mod v3 {
|
||||
pub not_membership: Option<MembershipEventFilter>,
|
||||
}
|
||||
|
||||
/// Response type for the `get_member_events` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// A list of member events.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/rooms/{roomId}/invite`
|
||||
//!
|
||||
//! Invite a user to a room.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec (MXID)][spec-mxid], [spec (3PID)][spec-3pid])
|
||||
@ -21,9 +23,7 @@ pub mod v3 {
|
||||
use crate::membership::{IncomingInvite3pid, Invite3pid};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Invite a user to a room.",
|
||||
method: POST,
|
||||
name: "invite_user",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -32,6 +32,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `invite_user` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The room where the user should be invited.
|
||||
@ -47,6 +48,7 @@ pub mod v3 {
|
||||
pub reason: Option<&'a str>,
|
||||
}
|
||||
|
||||
/// Response type for the `invite_user` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {}
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/rooms/{roomId}/join`
|
||||
//!
|
||||
//! Join a room using its ID.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -13,9 +15,7 @@ pub mod v3 {
|
||||
use crate::membership::{IncomingThirdPartySigned, ThirdPartySigned};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Join a room using its ID.",
|
||||
method: POST,
|
||||
name: "join_room_by_id",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -24,6 +24,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `join_room_by_id` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The room where the user should be invited.
|
||||
@ -40,6 +41,7 @@ pub mod v3 {
|
||||
pub reason: Option<&'a str>,
|
||||
}
|
||||
|
||||
/// Response type for the `join_room_by_id` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// The room that the user joined.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/join/{roomIdOrAlias}`
|
||||
//!
|
||||
//! Join a room using its ID or one of its aliases.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -13,9 +15,7 @@ pub mod v3 {
|
||||
use crate::membership::{IncomingThirdPartySigned, ThirdPartySigned};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Join a room using its ID or one of its aliases.",
|
||||
method: POST,
|
||||
name: "join_room_by_id_or_alias",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -24,6 +24,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `join_room_by_id_or_alias` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The room where the user should be invited.
|
||||
@ -47,6 +48,7 @@ pub mod v3 {
|
||||
pub reason: Option<&'a str>,
|
||||
}
|
||||
|
||||
/// Response type for the `join_room_by_id_or_alias` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// The room that the user joined.
|
||||
|
@ -1,4 +1,7 @@
|
||||
//! `GET /_matrix/client/*/rooms/{roomId}/joined_members`
|
||||
//!
|
||||
//! Get a map of user IDs to member info objects for members of the room. Primarily for use in
|
||||
//! Application Services.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -14,9 +17,7 @@ pub mod v3 {
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Get a map of user ids to member info objects for members of the room. Primarily for use in Application Services.",
|
||||
method: GET,
|
||||
name: "joined_members",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -25,6 +26,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `joined_members` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The room to get the members of.
|
||||
@ -32,6 +34,7 @@ pub mod v3 {
|
||||
pub room_id: &'a RoomId,
|
||||
}
|
||||
|
||||
/// Response type for the `joined_members` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// A list of the rooms the user is in, i.e.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/client/*/joined_rooms`
|
||||
//!
|
||||
//! Get a list of the user's current rooms.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -11,9 +13,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Get a list of the user's current rooms.",
|
||||
method: GET,
|
||||
name: "joined_rooms",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -22,10 +22,12 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `joined_rooms` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Request {}
|
||||
|
||||
/// Response type for the `joined_rooms` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// A list of the rooms the user is in, i.e. the ID of each room in
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/rooms/{roomId}/kick`
|
||||
//!
|
||||
//! Kick a user from a room.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -11,9 +13,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Kick a user from a room.",
|
||||
method: POST,
|
||||
name: "kick_user",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -22,6 +22,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `kick_user` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The room to kick the user from.
|
||||
@ -36,6 +37,7 @@ pub mod v3 {
|
||||
pub reason: Option<&'a str>,
|
||||
}
|
||||
|
||||
/// Response type for the `kick_user` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {}
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/rooms/{roomId}/leave`
|
||||
//!
|
||||
//! Leave a room.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -11,9 +13,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Leave a room.",
|
||||
method: POST,
|
||||
name: "leave_room",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -22,6 +22,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `leave_room` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The room to leave.
|
||||
@ -33,6 +34,7 @@ pub mod v3 {
|
||||
pub reason: Option<&'a str>,
|
||||
}
|
||||
|
||||
/// Response type for the `leave_room` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {}
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/client/*/user/mutual_rooms/{user_id}`
|
||||
//!
|
||||
//! Get mutual rooms with another user.
|
||||
|
||||
pub mod unstable {
|
||||
//! `/unstable/` ([spec])
|
||||
@ -11,9 +13,7 @@ pub mod unstable {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Get mutual rooms with another user.",
|
||||
method: GET,
|
||||
name: "mutual_rooms",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -21,6 +21,7 @@ pub mod unstable {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `mutual_rooms` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The user to search mutual rooms for.
|
||||
@ -28,6 +29,7 @@ pub mod unstable {
|
||||
pub user_id: &'a UserId,
|
||||
}
|
||||
|
||||
/// Response type for the `mutual_rooms` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// A list of rooms the user is in together with the authenticated user.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `POST /_matrix/client/*/rooms/{roomId}/unban`
|
||||
//!
|
||||
//! Unban a user from a room.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -11,9 +13,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Unban a user from a room.",
|
||||
method: POST,
|
||||
name: "unban_user",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -22,6 +22,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `unban_user` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The room to unban the user from.
|
||||
@ -36,6 +37,7 @@ pub mod v3 {
|
||||
pub reason: Option<&'a str>,
|
||||
}
|
||||
|
||||
/// Response type for the `unban_user` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {}
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/client/*/rooms/{roomId}/messages`
|
||||
//!
|
||||
//! Get message events for a room.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -20,9 +22,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Get message events for a room.",
|
||||
method: GET,
|
||||
name: "get_message_events",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -31,6 +31,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_message_events` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The room to get events from.
|
||||
@ -78,6 +79,7 @@ pub mod v3 {
|
||||
pub filter: RoomEventFilter<'a>,
|
||||
}
|
||||
|
||||
/// Response type for the `get_message_events` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `PUT /_matrix/client/*/rooms/{roomId}/send/{eventType}/{txnId}`
|
||||
//!
|
||||
//! Send a message event to a room.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -15,9 +17,7 @@ pub mod v3 {
|
||||
use serde_json::value::to_raw_value as to_raw_json_value;
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Send a message event to a room.",
|
||||
method: PUT,
|
||||
name: "create_message_event",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -26,6 +26,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `create_message_event` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The room to send the event to.
|
||||
@ -64,6 +65,7 @@ pub mod v3 {
|
||||
pub timestamp: Option<MilliSecondsSinceUnixEpoch>,
|
||||
}
|
||||
|
||||
/// Response type for the `create_message_event` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// A unique identifier for the event.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/client/*/presence/{userId}/status`
|
||||
//!
|
||||
//! Get presence status for this user.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -15,9 +17,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Get presence status for this user.",
|
||||
method: GET,
|
||||
name: "get_presence",
|
||||
rate_limited: false,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -26,6 +26,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_presence` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The user whose presence state will be retrieved.
|
||||
@ -33,6 +34,7 @@ pub mod v3 {
|
||||
pub user_id: &'a UserId,
|
||||
}
|
||||
|
||||
/// Response type for the `get_presence` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
pub struct Response {
|
||||
/// The state message for this user if one was set.
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `PUT /_matrix/client/*/presence/{userId}/status`
|
||||
//!
|
||||
//! Set presence status for this user.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -13,9 +15,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Set presence status for this user.",
|
||||
method: PUT,
|
||||
name: "set_presence",
|
||||
rate_limited: true,
|
||||
authentication: AccessToken,
|
||||
history: {
|
||||
@ -24,6 +24,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `set_presence` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The user whose presence state will be updated.
|
||||
@ -38,6 +39,7 @@ pub mod v3 {
|
||||
pub status_msg: Option<&'a str>,
|
||||
}
|
||||
|
||||
/// Response type for the `set_presence` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {}
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/client/*/profile/{userId}/avatar_url`
|
||||
//!
|
||||
//! Get the avatar URL of a user.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -11,9 +13,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Get the avatar URL of a user.",
|
||||
method: GET,
|
||||
name: "get_avatar_url",
|
||||
rate_limited: false,
|
||||
authentication: None,
|
||||
history: {
|
||||
@ -22,6 +22,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_avatar_url` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The user whose avatar URL will be retrieved.
|
||||
@ -29,6 +30,7 @@ pub mod v3 {
|
||||
pub user_id: &'a UserId,
|
||||
}
|
||||
|
||||
/// Response type for the `get_avatar_url` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/client/*/profile/{userId}/displayname`
|
||||
//!
|
||||
//! Get the display name of a user.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -11,9 +13,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Get the display name of a user.",
|
||||
method: GET,
|
||||
name: "get_display_name",
|
||||
rate_limited: false,
|
||||
authentication: None,
|
||||
history: {
|
||||
@ -22,6 +22,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_display_name` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The user whose display name will be retrieved.
|
||||
@ -29,6 +30,7 @@ pub mod v3 {
|
||||
pub user_id: &'a UserId,
|
||||
}
|
||||
|
||||
/// Response type for the `get_display_name` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {
|
||||
|
@ -1,4 +1,6 @@
|
||||
//! `GET /_matrix/client/*/profile/{userId}`
|
||||
//!
|
||||
//! Get all profile information of an user.
|
||||
|
||||
pub mod v3 {
|
||||
//! `/v3/` ([spec])
|
||||
@ -11,9 +13,7 @@ pub mod v3 {
|
||||
};
|
||||
|
||||
const METADATA: Metadata = metadata! {
|
||||
description: "Get all profile information of an user.",
|
||||
method: GET,
|
||||
name: "get_profile",
|
||||
rate_limited: false,
|
||||
authentication: None,
|
||||
history: {
|
||||
@ -22,6 +22,7 @@ pub mod v3 {
|
||||
}
|
||||
};
|
||||
|
||||
/// Request type for the `get_profile` endpoint.
|
||||
#[request(error = crate::Error)]
|
||||
pub struct Request<'a> {
|
||||
/// The user whose profile will be retrieved.
|
||||
@ -29,6 +30,7 @@ pub mod v3 {
|
||||
pub user_id: &'a UserId,
|
||||
}
|
||||
|
||||
/// Response type for the `get_profile` endpoint.
|
||||
#[response(error = crate::Error)]
|
||||
#[derive(Default)]
|
||||
pub struct Response {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user