client-api: Remove serde aliases

This commit is contained in:
Timo Kösters 2022-10-12 14:49:16 +02:00 committed by Kévin Commaille
parent d6b858c5fa
commit 00315d9c48
11 changed files with 8 additions and 39 deletions

View File

@ -87,11 +87,7 @@ pub mod v3 {
/// If set to `true`, the client supports [refresh tokens]. /// If set to `true`, the client supports [refresh tokens].
/// ///
/// [refresh tokens]: https://spec.matrix.org/v1.3/client-server-api/#refreshing-access-tokens /// [refresh tokens]: https://spec.matrix.org/v1.3/client-server-api/#refreshing-access-tokens
#[serde( #[serde(default, skip_serializing_if = "ruma_common::serde::is_default")]
default,
skip_serializing_if = "ruma_common::serde::is_default",
alias = "org.matrix.msc2918.refresh_token",
)]
pub refresh_token: bool, pub refresh_token: bool,
} }

View File

@ -40,7 +40,7 @@ pub mod v3 {
pub one_time_keys: BTreeMap<OwnedDeviceKeyId, Raw<OneTimeKey>>, pub one_time_keys: BTreeMap<OwnedDeviceKeyId, Raw<OneTimeKey>>,
/// Fallback public keys for "pre-key" messages. /// Fallback public keys for "pre-key" messages.
#[serde(default, skip_serializing_if = "BTreeMap::is_empty", alias = "org.matrix.msc2732.fallback_keys")] #[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
pub fallback_keys: BTreeMap<OwnedDeviceKeyId, Raw<OneTimeKey>>, pub fallback_keys: BTreeMap<OwnedDeviceKeyId, Raw<OneTimeKey>>,
} }

View File

@ -44,7 +44,6 @@ pub mod v3 {
default, default,
skip_serializing_if = "ruma_common::serde::is_default", skip_serializing_if = "ruma_common::serde::is_default",
rename = "xyz.amorgan.generate_blurhash", rename = "xyz.amorgan.generate_blurhash",
alias = "generate_blurhash"
)] )]
pub generate_blurhash: bool, pub generate_blurhash: bool,
} }

View File

@ -51,7 +51,6 @@ pub mod v3 {
default, default,
skip_serializing_if = "ruma_common::serde::is_default", skip_serializing_if = "ruma_common::serde::is_default",
rename = "fi.mau.msc2246.max_stall_ms", rename = "fi.mau.msc2246.max_stall_ms",
alias = "max_stall_ms"
)] )]
pub max_stall_ms: Option<UInt>, pub max_stall_ms: Option<UInt>,
} }

View File

@ -66,7 +66,6 @@ pub mod v3 {
default, default,
skip_serializing_if = "ruma_common::serde::is_default", skip_serializing_if = "ruma_common::serde::is_default",
rename = "fi.mau.msc2246.max_stall_ms", rename = "fi.mau.msc2246.max_stall_ms",
alias = "max_stall_ms"
)] )]
pub max_stall_ms: Option<UInt>, pub max_stall_ms: Option<UInt>,
} }

View File

@ -43,11 +43,7 @@ pub mod v3 {
/// This uses the unstable prefix in /// This uses the unstable prefix in
/// [MSC2448](https://github.com/matrix-org/matrix-spec-proposals/pull/2448). /// [MSC2448](https://github.com/matrix-org/matrix-spec-proposals/pull/2448).
#[cfg(feature = "unstable-msc2448")] #[cfg(feature = "unstable-msc2448")]
#[serde( #[serde(rename = "xyz.amorgan.blurhash", skip_serializing_if = "Option::is_none")]
rename = "xyz.amorgan.blurhash",
alias = "blurhash",
skip_serializing_if = "Option::is_none"
)]
pub blurhash: Option<String>, pub blurhash: Option<String>,
} }

View File

@ -47,11 +47,7 @@ pub mod v3 {
/// This uses the unstable prefix in /// This uses the unstable prefix in
/// [MSC2448](https://github.com/matrix-org/matrix-spec-proposals/pull/2448). /// [MSC2448](https://github.com/matrix-org/matrix-spec-proposals/pull/2448).
#[cfg(feature = "unstable-msc2448")] #[cfg(feature = "unstable-msc2448")]
#[serde( #[serde(rename = "xyz.amorgan.blurhash", skip_serializing_if = "Option::is_none")]
rename = "xyz.amorgan.blurhash",
alias = "blurhash",
skip_serializing_if = "Option::is_none"
)]
pub blurhash: Option<String>, pub blurhash: Option<String>,
} }

View File

@ -49,11 +49,7 @@ pub mod v3 {
/// This uses the unstable prefix in /// This uses the unstable prefix in
/// [MSC2448](https://github.com/matrix-org/matrix-spec-proposals/pull/2448). /// [MSC2448](https://github.com/matrix-org/matrix-spec-proposals/pull/2448).
#[cfg(feature = "unstable-msc2448")] #[cfg(feature = "unstable-msc2448")]
#[serde( #[serde(rename = "xyz.amorgan.blurhash", skip_serializing_if = "Option::is_none")]
rename = "xyz.amorgan.blurhash",
alias = "blurhash",
skip_serializing_if = "Option::is_none"
)]
pub blurhash: Option<&'a str>, pub blurhash: Option<&'a str>,
} }

View File

@ -50,11 +50,7 @@ pub mod v3 {
/// If set to `true`, the client supports [refresh tokens]. /// If set to `true`, the client supports [refresh tokens].
/// ///
/// [refresh tokens]: https://spec.matrix.org/v1.3/client-server-api/#refreshing-access-tokens /// [refresh tokens]: https://spec.matrix.org/v1.3/client-server-api/#refreshing-access-tokens
#[serde( #[serde(default, skip_serializing_if = "ruma_common::serde::is_default")]
default,
skip_serializing_if = "ruma_common::serde::is_default",
alias = "org.matrix.msc2918.refresh_token",
)]
pub refresh_token: bool, pub refresh_token: bool,
} }

View File

@ -217,11 +217,7 @@ pub mod v3 {
#[cfg_attr(feature = "server", derive(serde::Deserialize))] #[cfg_attr(feature = "server", derive(serde::Deserialize))]
struct RequestQuery { struct RequestQuery {
/// Timestamp to use for the `origin_server_ts` of the event. /// Timestamp to use for the `origin_server_ts` of the event.
#[serde( #[serde(rename = "ts", skip_serializing_if = "Option::is_none")]
alias = "org.matrix.msc3316.ts",
rename = "ts",
skip_serializing_if = "Option::is_none"
)]
pub timestamp: Option<MilliSecondsSinceUnixEpoch>, pub timestamp: Option<MilliSecondsSinceUnixEpoch>,
} }
} }

View File

@ -289,11 +289,7 @@ pub struct JoinedRoom {
/// ///
/// [MSC2654]: https://github.com/matrix-org/matrix-spec-proposals/pull/2654 /// [MSC2654]: https://github.com/matrix-org/matrix-spec-proposals/pull/2654
#[cfg(feature = "unstable-msc2654")] #[cfg(feature = "unstable-msc2654")]
#[serde( #[serde(rename = "org.matrix.msc2654.unread_count", skip_serializing_if = "Option::is_none")]
rename = "org.matrix.msc2654.unread_count",
alias = "unread_count",
skip_serializing_if = "Option::is_none"
)]
pub unread_count: Option<UInt>, pub unread_count: Option<UInt>,
} }