diff --git a/crates/ruma-client-api/src/profile.rs b/crates/ruma-client-api/src/profile.rs index 797ff4f5..2c5293c6 100644 --- a/crates/ruma-client-api/src/profile.rs +++ b/crates/ruma-client-api/src/profile.rs @@ -7,3 +7,4 @@ pub mod get_timezone_key; pub mod set_avatar_url; pub mod set_display_name; pub mod set_timezone_key; +pub mod delete_timezone_key; diff --git a/crates/ruma-client-api/src/profile/delete_timezone_key.rs b/crates/ruma-client-api/src/profile/delete_timezone_key.rs new file mode 100644 index 00000000..18cfa56d --- /dev/null +++ b/crates/ruma-client-api/src/profile/delete_timezone_key.rs @@ -0,0 +1,47 @@ +//! `DELETE /_matrix/client/*/profile/{userId}/m.tz` +//! +//! Deletes the timezone key of the user. + +pub mod unstable { + use ruma_common::{ + api::{request, response, Metadata}, + metadata, OwnedUserId, + }; + + const METADATA: Metadata = metadata! { + method: DELETE, + rate_limited: true, + authentication: AccessToken, + history: { + unstable => "/_matrix/client/unstable/uk.tcpip.msc4133/profile/:user_id/us.cloke.msc4175.tz", + // 1.12 => "/_matrix/client/v3/profile/:user_id/m.tz", + } + }; + + /// Request type for the `delete_timezone_key` endpoint. + #[request(error = crate::Error)] + pub struct Request { + /// The user whose timezone will be deleted. + #[ruma_api(path)] + pub user_id: OwnedUserId, + } + + /// Response type for the `delete_timezone_key` endpoint. + #[response(error = crate::Error)] + #[derive(Default)] + pub struct Response {} + + impl Request { + /// Creates a new `Request` with the given user ID. + pub fn new(user_id: OwnedUserId) -> Self { + Self { user_id } + } + } + + impl Response { + /// Creates an empty `Response`. + pub fn new() -> Self { + Self {} + } + } +}