client-api: Use GlobalAccountDataEventType in get_global_account_data

This commit is contained in:
Kévin Commaille 2023-01-04 15:45:06 +01:00 committed by Kévin Commaille
parent 4d40623ae4
commit 423c03f5d2
2 changed files with 4 additions and 3 deletions

View File

@ -15,6 +15,7 @@ Breaking changes:
* Use `NewPushRule` to construct a `push::set_pushrule::v3::Request` * Use `NewPushRule` to construct a `push::set_pushrule::v3::Request`
* `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`
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::AnyGlobalAccountDataEventContent, events::{AnyGlobalAccountDataEventContent, GlobalAccountDataEventType},
metadata, metadata,
serde::Raw, serde::Raw,
OwnedUserId, OwnedUserId,
@ -34,7 +34,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: GlobalAccountDataEventType,
} }
/// Response type for the `get_global_account_data` endpoint. /// Response type for the `get_global_account_data` endpoint.
@ -49,7 +49,7 @@ pub mod v3 {
impl Request { impl Request {
/// Creates a new `Request` with the given user ID and event type. /// 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 } Self { user_id, event_type }
} }
} }