From 423c03f5d29ae18b88e9b89fa087547ee136cb1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Wed, 4 Jan 2023 15:45:06 +0100 Subject: [PATCH] client-api: Use GlobalAccountDataEventType in get_global_account_data --- crates/ruma-client-api/CHANGELOG.md | 1 + .../ruma-client-api/src/config/get_global_account_data.rs | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/ruma-client-api/CHANGELOG.md b/crates/ruma-client-api/CHANGELOG.md index b4b0c0cd..7fa31233 100644 --- a/crates/ruma-client-api/CHANGELOG.md +++ b/crates/ruma-client-api/CHANGELOG.md @@ -15,6 +15,7 @@ Breaking changes: * Use `NewPushRule` to construct a `push::set_pushrule::v3::Request` * `Error` is now an enum because endpoint error construction is infallible (see changelog for `ruma-common`); the previous fields are in the `Standard` variant +* Use `GlobalAccountDataEventType` for `event_type` in `config::get_global_account_data` Improvements: diff --git a/crates/ruma-client-api/src/config/get_global_account_data.rs b/crates/ruma-client-api/src/config/get_global_account_data.rs index afa6382f..2e0940e7 100644 --- a/crates/ruma-client-api/src/config/get_global_account_data.rs +++ b/crates/ruma-client-api/src/config/get_global_account_data.rs @@ -9,7 +9,7 @@ pub mod v3 { use ruma_common::{ api::{request, response, Metadata}, - events::AnyGlobalAccountDataEventContent, + events::{AnyGlobalAccountDataEventContent, GlobalAccountDataEventType}, metadata, serde::Raw, OwnedUserId, @@ -34,7 +34,7 @@ pub mod v3 { /// Type of data to retrieve. #[ruma_api(path)] - pub event_type: String, + pub event_type: GlobalAccountDataEventType, } /// Response type for the `get_global_account_data` endpoint. @@ -49,7 +49,7 @@ pub mod v3 { impl Request { /// Creates a new `Request` with the given user ID and event type. - pub fn new(user_id: OwnedUserId, event_type: String) -> Self { + pub fn new(user_id: OwnedUserId, event_type: GlobalAccountDataEventType) -> Self { Self { user_id, event_type } } }