client-api: Update get_message_events for v1.1

* Remove serde(skip_serializing_if = ...) attribute from chunk response field
* Make the start response field required by changing its type from
  Option<String> to String
This commit is contained in:
plustik 2022-01-11 16:28:11 +01:00 committed by GitHub
parent 993cd30f46
commit b3f7d0ed52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -18,6 +18,8 @@ Breaking changes:
`r0::account::request_3pid_management_token_via_email`
* `get_contacts` has been can now be found at `r0::account::get_3pids`
* Move `r0::uiaa::authorize_fallback` to `r0::uiaa::get_uiaa_fallback_page`
* Change type of field `start` of `r0::message::get_message_events::Response` to
`String` in accordance with the updated specification.
Improvements:

View File

@ -1,4 +1,4 @@
//! [GET /_matrix/client/r0/rooms/{roomId}/messages](https://matrix.org/docs/spec/client_server/r0.6.1#get-matrix-client-r0-rooms-roomid-messages)
//! [GET /_matrix/client/r0/rooms/{roomId}/messages](https://spec.matrix.org/v1.1/client-server-api/#get_matrixclientv3roomsroomidmessages)
use js_int::{uint, UInt};
use ruma_api::ruma_api;
@ -65,15 +65,14 @@ ruma_api! {
#[derive(Default)]
response: {
/// The token the pagination starts from.
#[serde(skip_serializing_if = "Option::is_none")]
pub start: Option<String>,
pub start: String,
/// The token the pagination ends at.
#[serde(skip_serializing_if = "Option::is_none")]
pub end: Option<String>,
/// A list of room events.
#[serde(default, skip_serializing_if = "Vec::is_empty")]
#[serde(default)]
pub chunk: Vec<Raw<AnyRoomEvent>>,
/// A list of state events relevant to showing the `chunk`.