client-api: Use RoomAccountDataEventType in get_room_account_data

This commit is contained in:
Kévin Commaille 2023-01-04 15:46:03 +01:00 committed by Kévin Commaille
parent 423c03f5d2
commit 6b31f66afc
2 changed files with 8 additions and 3 deletions

View File

@ -16,6 +16,7 @@ Breaking changes:
* `Error` is now an enum because endpoint error construction is infallible (see changelog for * `Error` is now an enum because endpoint error construction is infallible (see changelog for
`ruma-common`); the previous fields are in the `Standard` variant `ruma-common`); the previous fields are in the `Standard` variant
* Use `GlobalAccountDataEventType` for `event_type` in `config::get_global_account_data` * Use `GlobalAccountDataEventType` for `event_type` in `config::get_global_account_data`
* Use `RoomAccountDataEventType` for `event_type` in `config::get_room_account_data`
Improvements: Improvements:

View File

@ -9,7 +9,7 @@ pub mod v3 {
use ruma_common::{ use ruma_common::{
api::{request, response, Metadata}, api::{request, response, Metadata},
events::AnyRoomAccountDataEventContent, events::{AnyRoomAccountDataEventContent, RoomAccountDataEventType},
metadata, metadata,
serde::Raw, serde::Raw,
OwnedRoomId, OwnedUserId, OwnedRoomId, OwnedUserId,
@ -38,7 +38,7 @@ pub mod v3 {
/// Type of data to retrieve. /// Type of data to retrieve.
#[ruma_api(path)] #[ruma_api(path)]
pub event_type: String, pub event_type: RoomAccountDataEventType,
} }
/// Response type for the `get_room_account_data` endpoint. /// Response type for the `get_room_account_data` endpoint.
@ -53,7 +53,11 @@ pub mod v3 {
impl Request { impl Request {
/// Creates a new `Request` with the given user ID, room ID and event type. /// Creates a new `Request` with the given user ID, room ID and event type.
pub fn new(user_id: OwnedUserId, room_id: OwnedRoomId, event_type: String) -> Self { pub fn new(
user_id: OwnedUserId,
room_id: OwnedRoomId,
event_type: RoomAccountDataEventType,
) -> Self {
Self { user_id, room_id, event_type } Self { user_id, room_id, event_type }
} }
} }