From 478385f0f20b878288290ff76febcc915c1817d0 Mon Sep 17 00:00:00 2001 From: Devin Ragotzy Date: Sat, 8 Aug 2020 08:07:03 -0400 Subject: [PATCH] Add room::aliases endpoint --- ruma-client-api/CHANGELOG.md | 4 ++++ ruma-client-api/src/r0/room/aliases.rs | 27 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 ruma-client-api/src/r0/room/aliases.rs diff --git a/ruma-client-api/CHANGELOG.md b/ruma-client-api/CHANGELOG.md index 6f3c5967..19ae6606 100644 --- a/ruma-client-api/CHANGELOG.md +++ b/ruma-client-api/CHANGELOG.md @@ -6,6 +6,10 @@ Breaking changes: `Option` to `UInt` * Update strum dependency to 0.19 +Improvements: + +* Add `r0::room::aliases` (introduced in r0.6.1) + # 0.10.0 Bug fixes: diff --git a/ruma-client-api/src/r0/room/aliases.rs b/ruma-client-api/src/r0/room/aliases.rs new file mode 100644 index 00000000..a96edc89 --- /dev/null +++ b/ruma-client-api/src/r0/room/aliases.rs @@ -0,0 +1,27 @@ +//! [PUT /_matrix/client/r0/directory/room/{roomAlias}](https://matrix.org/docs/spec/client_server/r0.6.0#put-matrix-client-r0-directory-room-roomalias) + +use ruma_api::ruma_api; +use ruma_identifiers::{RoomAliasId, RoomId}; + +ruma_api! { + metadata: { + description: "Get a list of local aliases on a given room.", + method: PUT, + name: "create_alias", + path: "/_matrix/client/r0/directory/room/:room_id", + rate_limited: false, + requires_authentication: true, + } + + request: { + /// The room ID to get aliases of. + #[ruma_api(path)] + pub room_id: &'a RoomId, + } + + response: { + aliases: &'a [RoomAliasId], + } + + error: crate::Error +}